summaryrefslogtreecommitdiff
path: root/libsm/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsm/util.c')
-rw-r--r--libsm/util.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libsm/util.c b/libsm/util.c
index dd8bf88f79e5..2610a3dfe553 100644
--- a/libsm/util.c
+++ b/libsm/util.c
@@ -132,10 +132,11 @@ str2prt(s)
** ibp -- a pointer to the string to translate [x]
** obp -- a pointer to an output buffer [i][m:A]
** bsp -- pointer to the length of the output buffer
+** rpool -- rpool for allocations
**
** Returns:
-** A possibly new bp (if the buffer needed to grow); if
-** it is different, *bsp will updated to the size of
+** A possibly new obp (if the buffer needed to grow);
+** if it is different, *bsp will updated to the size of
** the new buffer and the caller is responsible for
** freeing the memory.
*/
@@ -171,7 +172,12 @@ quote_internal_chars
int bufused, olen;
bool buffer_same, needs_quoting;
+ if (NULL == ibp)
+ return NULL;
buffer_same = ibp == obp;
+ SM_REQUIRE(NULL != bsp);
+ if (NULL == obp)
+ *bsp = 0;
needs_quoting = false;
/* determine length of output string (starts at 1 for trailing '\0') */