diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-21 22:51:54 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-22 11:47:14 +0200 |
commit | 21fc7a4b7422f8b441a6266a11cc8e337aae190d (patch) | |
tree | ea32977883135de411f75f82eb5089792fc3ac2d /src/config.c | |
parent | 6203966fbf1f8886ff59cc9d6350b034ee5374c9 (diff) | |
download | calcurse-21fc7a4b7422f8b441a6266a11cc8e337aae190d.tar.gz calcurse-21fc7a4b7422f8b441a6266a11cc8e337aae190d.zip |
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>
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c index 5eb526a..5ce7001 100644 --- a/src/config.c +++ b/src/config.c @@ -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; |