diff options
author | Russ Allbery <rra@stanford.edu> | 2011-10-28 18:20:40 -0700 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2011-10-28 18:20:40 -0700 |
commit | ab300c2b6be6ab5492dd6bf938c9d35f61f936a9 (patch) | |
tree | ede989b998f4e14cdc67a0c252a8d56c561d2c8a /util | |
parent | 92b7e2301f19bfb97045a6191a15dc3311e3677a (diff) |
Update to rra-c-util 3.10
* Fix removal of -I/usr/include from GSS-API CPPFLAGS.
* Provide ssize_t on platforms without it, such as Windows.
* Fix vector_join and cvector_join with empty vectors.
Diffstat (limited to 'util')
-rw-r--r-- | util/messages.h | 2 | ||||
-rw-r--r-- | util/vector.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/util/messages.h b/util/messages.h index 0f8b5b6..463137c 100644 --- a/util/messages.h +++ b/util/messages.h @@ -94,7 +94,7 @@ void message_log_syslog_crit(size_t, const char *, va_list, int) __attribute__((__nonnull__)); /* The type of a message handler. */ -typedef void (*message_handler_func)(unsigned int, const char *, va_list, int); +typedef void (*message_handler_func)(size_t, const char *, va_list, int); /* If non-NULL, called before exit and its return value passed to exit. */ extern int (*message_fatal_cleanup)(void); diff --git a/util/vector.c b/util/vector.c index 285969c..6324940 100644 --- a/util/vector.c +++ b/util/vector.c @@ -500,6 +500,8 @@ vector_join(const struct vector *vector, const char *seperator) char *string; size_t i, size, seplen; + if (vector->count == 0) + return xstrdup(""); seplen = strlen(seperator); for (size = 0, i = 0; i < vector->count; i++) size += strlen(vector->strings[i]); @@ -521,6 +523,8 @@ cvector_join(const struct cvector *vector, const char *seperator) char *string; size_t i, size, seplen; + if (vector->count == 0) + return xstrdup(""); seplen = strlen(seperator); for (size = 0, i = 0; i < vector->count; i++) size += strlen(vector->strings[i]); |