OSSP CVS Repository

ossp - Difference in ossp-pkg/var/var.c versions 1.30 and 1.31
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/var/var.c 1.30 -> 1.31

--- var.c        2001/11/20 12:24:53     1.30
+++ var.c        2001/11/20 12:45:10     1.31
@@ -1314,7 +1314,7 @@
 
     case '#':                   /* Substitute length of the string. */
         if (data->begin) {
-            char buf[1024];
+            char buf[32];       //FIXME: thl 2^64 would fit into 20chars ...
             sprintf(buf, "%d", data->end - data->begin);
             tokenbuf_free(data);
             if (!tokenbuf_assign(data, buf, strlen(buf))) {
@@ -1331,11 +1331,11 @@
                                  lookup_context, force_expand, &tmptokbuf);
         if (rc < 0)
             goto error_return;
-        else if (rc == 0) {
+        if (rc == 0) {
             rc = VAR_ERR_MISSING_PARAMETER_IN_COMMAND;
             goto error_return;
-        } else
-            p += rc;
+        }
+        p += rc;
         if (data->begin != NULL && data->begin == data->end) {
             tokenbuf_free(data);
             tokenbuf_move(&tmptokbuf, data);
@@ -1348,11 +1348,11 @@
                                  lookup_context, force_expand, &tmptokbuf);
         if (rc < 0)
             goto error_return;
-        else if (rc == 0) {
+        if (rc == 0) {
             rc = VAR_ERR_MISSING_PARAMETER_IN_COMMAND;
             goto error_return;
-        } else
-            p += rc;
+        }
+        p += rc;
         if (data->begin != NULL) {
             if (data->begin == data->end) {
                 tokenbuf_free(data);
@@ -1371,16 +1371,14 @@
                                  lookup_context, force_expand, &tmptokbuf);
         if (rc < 0)
             goto error_return;
-        else if (rc == 0) {
+        if (rc == 0) {
             rc = VAR_ERR_MISSING_PARAMETER_IN_COMMAND;
             goto error_return;
-        } else
-            p += rc;
-        if (data->begin != NULL) {
-            if (data->begin != data->end) {
-                tokenbuf_free(data);
-                tokenbuf_move(&tmptokbuf, data);
-            }
+        }
+        p += rc;
+        if (data->begin != NULL && data->begin != data->end) {
+            tokenbuf_free(data);
+            tokenbuf_move(&tmptokbuf, data);
         }
         break;
 

CVSTrac 2.0.1