about summary refs log tree commit diff
path: root/util.h
diff options
context:
space:
mode:
authorHeikki Kallasjoki <fis@zem.fi>2018-11-16 22:02:08 +0000
committerHeikki Kallasjoki <fis@zem.fi>2018-11-16 22:02:08 +0000
commitf771790b633f02f3857689e9848b0756aeb30b98 (patch)
treee50dd29b7b217396265cd07709c1e00b3880b59d /util.h
parente30fd51e676a9d03286c6dce5950314019800de4 (diff)
downloadnano-exporter-f771790b633f02f3857689e9848b0756aeb30b98.tar.gz
nano-exporter-f771790b633f02f3857689e9848b0756aeb30b98.tar.xz
nano-exporter-f771790b633f02f3857689e9848b0756aeb30b98.zip
Bugfix: cbuf_cmp handled prefixes incorrectly.
The previous version returned 0 if the string to compare was either
equal to or a prefix of the target buffer. This change fixes it to
only return 0 when the string is actually equal. Otherwise, it follows
the shortlex ordering, for convenience.
Diffstat (limited to 'util.h')
-rw-r--r--util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/util.h b/util.h
index 70cd474..e1acc35 100644
--- a/util.h
+++ b/util.h
@@ -17,6 +17,7 @@ void cbuf_puts(cbuf *buf, const char *src);
 void cbuf_putc(cbuf *buf, int c);
 void cbuf_putf(cbuf *buf, const char *fmt, ...);
 const char *cbuf_get(struct cbuf *buf, size_t *len);
+/** Compares the contents of \p buf to the string in \p other, in shortlex order. */
 int cbuf_cmp(cbuf *buf, const char *other);
 
 // string lists