From ccb09d80a9e118d17e7553a1977f322f1df09375 Mon Sep 17 00:00:00 2001 From: leitner Date: Sun, 14 Jul 2002 22:42:49 +0000 Subject: [PATCH] document failure case of stralloc_ready --- stralloc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stralloc.h b/stralloc.h index a9a6790..ec4f8a8 100644 --- a/stralloc.h +++ b/stralloc.h @@ -20,7 +20,8 @@ typedef struct stralloc { * len bytes of space, and returns 1. If sa is already allocated, but * not enough to hold len bytes, stralloc_ready allocates at least len * bytes of space, copies the old string into the new space, frees the - * old space, and returns 1. Note that this changes sa.s. */ + * old space, and returns 1. Note that this changes sa.s. If the + * allocation fails, stralloc_ready leaves sa alone and returns 0. */ extern int stralloc_ready(stralloc* sa,unsigned int len); /* stralloc_readyplus is like stralloc_ready except that, if sa is