summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2011-10-28 18:20:40 -0700
committerRuss Allbery <rra@stanford.edu>2011-10-28 18:20:40 -0700
commitab300c2b6be6ab5492dd6bf938c9d35f61f936a9 (patch)
treeede989b998f4e14cdc67a0c252a8d56c561d2c8a /util
parent92b7e2301f19bfb97045a6191a15dc3311e3677a (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.h2
-rw-r--r--util/vector.c4
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]);