Check return value from asprintf instead of string != NULL since it
undefined behavior on Linux. From Björn Sandell git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16224 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -244,9 +244,10 @@ init_words (int argc, char **argv)
|
||||
appres.file = argv[i];
|
||||
i++;
|
||||
} else {
|
||||
asprintf (&appres.file,
|
||||
int ret;
|
||||
ret = asprintf (&appres.file,
|
||||
"%s/.msgfile", getenv("HOME"));
|
||||
if (appres.file == NULL)
|
||||
if (ret == -1)
|
||||
errx (1, "cannot allocate memory for message");
|
||||
}
|
||||
} else if(strcmp(argv[i], "--version") == 0) {
|
||||
|
Reference in New Issue
Block a user