Replace several uses of snprintf() by asprintf()
Use asprintf() in some cold code paths. While allocating memory on the heap is a bit slower, using asprintf() is a bit more memory efficient and less prone to buffer overflow errors. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
@@ -449,8 +449,7 @@ config_serialize_conf(char *buf, const char *key,
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(confmap); i++) {
|
||||
if (!strcmp(confmap[i].key, key)) {
|
||||
if (confmap[i].
|
||||
fn_serialize(buf, confmap[i].target)) {
|
||||
if (confmap[i].fn_serialize(buf, confmap[i].target)) {
|
||||
if (status)
|
||||
status->done[i] = 1;
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user