Skip to content
Snippets Groups Projects
Commit 02146d28 authored by Adriano Da Luz's avatar Adriano Da Luz Committed by Danilo K. S. Yorinori
Browse files

client.c: Added code to force end-of-string marker on basedir string


This is necessary because strncpy for Windows does not add the
end-of-string marker on the end of string.

Signed-off-by: default avatarAdriano Da Luz <al08@c3sl.ufpr.br>
Acked-by: default avatarErik Alexandre Pucci <eap08@c3sl.ufpr.br>
Signed-off-by: default avatarDanilo K. S. Yorinori <danilok@c3sl.ufpr.br>
parent 59bf91a8
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ int main(int argc, char **argv) ...@@ -61,7 +61,7 @@ int main(int argc, char **argv)
len = strlen(EXEFILE); len = strlen(EXEFILE);
basedir = (char *) malloc(sizeof(char) * (arglen - len + 1)); basedir = (char *) malloc(sizeof(char) * (arglen - len + 1));
strncpy(basedir, argv[0], (arglen - len)); strncpy(basedir, argv[0], (arglen - len));
basedir[arglen - len] = '\0';
DEBUG("Arg: %s basedir: %s\n", argv[0], basedir); DEBUG("Arg: %s basedir: %s\n", argv[0], basedir);
if ((option != 1) && (inep) && (inep[0] == '\0')) if ((option != 1) && (inep) && (inep[0] == '\0'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment