elm_prefs.c: make the string null terminated.

This fixes coverity CID 1046593 : Buffer not null terminated (BUFFER_SIZE_WARNING).
This commit is contained in:
Daniel Juyung Seo 2013-08-11 17:21:31 +09:00
parent 4f8206d650
commit 298af57c54
1 changed files with 2 additions and 1 deletions

View File

@ -333,7 +333,8 @@ _elm_prefs_item_node_by_name(Elm_Prefs_Smart_Data *sd,
char *token;
char *aux = buf;
strncpy(buf, name, PATH_MAX);
strncpy(buf, name, PATH_MAX - 1);
buf[PATH_MAX - 1] = '\0';
token = strsep(&aux, ":");