summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aef5071)
raw | patch | inline | side by side (parent: aef5071)
author | Florian Forster <octo@collectd.org> | |
Wed, 8 Jul 2015 10:39:56 +0000 (12:39 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 8 Jul 2015 10:39:56 +0000 (12:39 +0200) |
Also re-indent oconfig_clone().
src/liboconfig/oconfig.c | patch | blob | history |
index ba93062cddef8b2498a6895daa9746911eeb2cc1..d01c79dd3f164f5da66bf17b208c0af4d534164a 100644 (file)
--- a/src/liboconfig/oconfig.c
+++ b/src/liboconfig/oconfig.c
yyset_in (fh);
if (NULL == c_file) {
- int status;
-
status = snprintf (file, sizeof (file), "<fd#%d>", fileno (fh));
- if ((status < 0) || (status >= sizeof (file))) {
+ if ((status < 0) || (((size_t) status) >= sizeof (file))) {
c_file = "<unknown>";
}
else {
ci_copy->values[i].type = ci_orig->values[i].type;
if (ci_copy->values[i].type == OCONFIG_TYPE_STRING)
{
- ci_copy->values[i].value.string
- = strdup (ci_orig->values[i].value.string);
- if (ci_copy->values[i].value.string == NULL)
- {
- fprintf (stderr, "strdup failed.\n");
- oconfig_free (ci_copy);
- return (NULL);
- }
+ ci_copy->values[i].value.string = strdup (ci_orig->values[i].value.string);
+ if (ci_copy->values[i].value.string == NULL)
+ {
+ fprintf (stderr, "strdup failed.\n");
+ oconfig_free (ci_copy);
+ return (NULL);
+ }
}
else /* ci_copy->values[i].type != OCONFIG_TYPE_STRING) */
{
- ci_copy->values[i].value = ci_orig->values[i].value;
+ ci_copy->values[i].value = ci_orig->values[i].value;
}
}
} /* }}} if (ci_orig->values_num > 0) */