(config_file.c) Use snprintf
This commit is contained in:
parent
24910b6999
commit
dd13e6b044
|
@ -1181,12 +1181,14 @@ void config_file_dump_orbis(config_file_t *conf, int fd)
|
||||||
while (includes)
|
while (includes)
|
||||||
{
|
{
|
||||||
char cad[256];
|
char cad[256];
|
||||||
sprintf(cad,"#include %s\n", includes->path);
|
snprintf(cad, sizeof(cad),
|
||||||
|
"#include %s\n", includes->path);
|
||||||
orbisWrite(fd, cad, strlen(cad));
|
orbisWrite(fd, cad, strlen(cad));
|
||||||
includes = includes->next;
|
includes = includes->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
list = merge_sort_linked_list((struct config_entry_list*)conf->entries, config_sort_compare_func);
|
list = merge_sort_linked_list((struct config_entry_list*)
|
||||||
|
conf->entries, config_sort_compare_func);
|
||||||
conf->entries = list;
|
conf->entries = list;
|
||||||
|
|
||||||
while (list)
|
while (list)
|
||||||
|
@ -1194,7 +1196,8 @@ void config_file_dump_orbis(config_file_t *conf, int fd)
|
||||||
if (!list->readonly && list->key)
|
if (!list->readonly && list->key)
|
||||||
{
|
{
|
||||||
char newlist[256];
|
char newlist[256];
|
||||||
sprintf(newlist,"%s = %s\n", list->key, list->value);
|
snprintf(newlist, sizeof(newlist),
|
||||||
|
"%s = %s\n", list->key, list->value);
|
||||||
orbisWrite(fd, newlist, strlen(newlist));
|
orbisWrite(fd, newlist, strlen(newlist));
|
||||||
}
|
}
|
||||||
list = list->next;
|
list = list->next;
|
||||||
|
|
Loading…
Reference in New Issue