Comment and errno changes
authorPekka Riikonen <priikone@silcnet.org>
Tue, 15 Jan 2008 06:36:54 +0000 (06:36 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 15 Jan 2008 06:36:54 +0000 (06:36 +0000)
lib/silcutil/silcbuffer.h
lib/silcutil/silcbuffmt.c

index 6edf2b9903e26af2089ca95c66478346784162cb..dc9d405cdb51ea3b0714179ab9261c2b1e16fed6 100644 (file)
@@ -569,7 +569,7 @@ unsigned char *silc_buffer_pull(SilcBuffer sb, SilcUInt32 len)
  *    Pushes current data area towards beginning. Length of the currently
  *    valid data area is also incremented. Returns a pointer to the
  *    data area before pushing. Returns NULL if the push would lead to
- *    buffer underflow or would go under the valid data area.
+ *    go beyond the buffer boundaries or current data area.
  *
  * EXAMPLE
  *
@@ -597,7 +597,7 @@ unsigned char *silc_buffer_push(SilcBuffer sb, SilcUInt32 len)
   SILC_ASSERT((sb->data - len) >= sb->head);
 #endif /* SILC_DIST_INPLACE */
   if (silc_unlikely((sb->data - len) < sb->head)) {
-    silc_set_errno(SILC_ERR_UNDERFLOW);
+    silc_set_errno(SILC_ERR_OVERFLOW);
     return NULL;
   }
 
@@ -664,7 +664,7 @@ unsigned char *silc_buffer_pull_tail(SilcBuffer sb, SilcUInt32 len)
  *    Pushes current tail section towards beginning. Length of the current
  *    valid data area is also decremented. Returns a pointer to the
  *    tail section before pushing. Returns NULL if the push would lead to
- *    buffer underflow or go under valid tail area.
+ *    go beyond buffer boundaries or current tail area.
  *
  * EXAMPLE
  *
@@ -692,7 +692,7 @@ unsigned char *silc_buffer_push_tail(SilcBuffer sb, SilcUInt32 len)
   SILC_ASSERT((sb->tail - len) >= sb->data);
 #endif /* SILC_DIST_INPLACE */
   if (silc_unlikely((sb->tail - len) < sb->data)) {
-    silc_set_errno(SILC_ERR_UNDERFLOW);
+    silc_set_errno(SILC_ERR_OVERFLOW);
     return NULL;
   }
 
index 2daf348f77c1d45d09c5168b44556df5741116ef..6534696384896110510b0844fa623379fb38f49b 100644 (file)
@@ -49,7 +49,7 @@ do {                                                  \
     goto fail;                                         \
   }                                                    \
   if (silc_unlikely((req + 1) <= 0)) {                 \
-    silc_set_errno(SILC_ERR_UNDERFLOW);                        \
+    silc_set_errno(SILC_ERR_OVERFLOW);                 \
     goto fail;                                         \
   }                                                    \
 } while(0)