[uim-commit] r2592 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Thu Dec 15 18:57:55 PST 2005


Author: yamaken
Date: 2005-12-15 18:57:51 -0800 (Thu, 15 Dec 2005)
New Revision: 2592

Modified:
   branches/r5rs/sigscheme/strport.c
Log:
* sigscheme/strport.c
  - (ostrport_append): Modify coding style


Modified: branches/r5rs/sigscheme/strport.c
===================================================================
--- branches/r5rs/sigscheme/strport.c	2005-12-16 02:32:07 UTC (rev 2591)
+++ branches/r5rs/sigscheme/strport.c	2005-12-16 02:57:51 UTC (rev 2592)
@@ -412,14 +412,11 @@
 static size_t
 ostrport_append(ScmOutputStrPort *port, size_t len, const char *str)
 {
-    char *new_str = NULL;
+    char *new_str;
 
     /* extend the buffer */
     if (port->buf_size - port->cur < len + sizeof((char)'\0')) {
-        if (port->buf_size == 0)
-            port->buf_size += sizeof((char)'\0');
-
-        port->buf_size += len;
+        port->buf_size += (!port->buf_size) ? sizeof((char)'\0') : len;
         new_str = realloc(port->str, port->buf_size);
         if (!new_str)
             SCM_PORT_ERROR_NOMEM(BYTE, NULL, ScmOutputStrPort);



More information about the uim-commit mailing list