projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8cae217
)
Make return result consistent with fixed src/utils/common/common.c - ssnprintf wrapper
author
Zebity Spring
<zebity@yahoo.com>
Wed, 18 Sep 2019 11:33:27 +0000
(21:33 +1000)
committer
Zebity Spring
<zebity@yahoo.com>
Wed, 18 Sep 2019 11:33:27 +0000
(21:33 +1000)
src/collectdctl.c
patch
|
blob
|
history
diff --git
a/src/collectdctl.c
b/src/collectdctl.c
index
df83b50
..
3974fd0
100644
(file)
--- a/
src/collectdctl.c
+++ b/
src/collectdctl.c
@@
-81,8
+81,7
@@
extern char *optarg;
extern int optind;
extern char *optarg;
extern int optind;
-/* ssnprintf returns zero on success, one if truncation occurred
- and a negative integer onerror. */
+/* _ssnprintf returns result from vsnprintf (consistent with snprintf) */
static int _ssnprintf(char *str, size_t sz, const char *format, ...) {
va_list ap;
va_start(ap, format);
static int _ssnprintf(char *str, size_t sz, const char *format, ...) {
va_list ap;
va_start(ap, format);
@@
-91,10
+90,7
@@
static int _ssnprintf(char *str, size_t sz, const char *format, ...) {
va_end(ap);
va_end(ap);
- if (ret < 0) {
- return ret;
- }
- return (size_t)ret >= sz;
+ return ret;
} /* int _ssnprintf */
__attribute__((noreturn)) static void exit_usage(const char *name, int status) {
} /* int _ssnprintf */
__attribute__((noreturn)) static void exit_usage(const char *name, int status) {