OSSP CVS Repository

ossp - Check-in [2730]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2730
Date: 2002-Nov-05 15:51:37 (local)
2002-Nov-05 14:51:37 (UTC)
User:mlelstv
Branch:
Comment: size_t is unsigned -> get rid of possible negative offsets that weren't used anywhere. remove sanity checks for 'unsigned < 0'.

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/sio/al.c      1.33 -> 1.34     1 inserted, 5 deleted

ossp-pkg/sio/al.c 1.33 -> 1.34

--- al.c 2002/11/04 13:14:50     1.33
+++ al.c 2002/11/05 14:51:37     1.34
@@ -291,7 +291,7 @@
     al_chunk_t *alc;
     size_t len = AL_CHUNK_LEN(orig);
 
-    if (off < 0 || off > len)
+    if (off > len)
         return AL_ERR_ARG;
 
     rc = new_chunk(al, orig->buf, orig->label, &alc);
@@ -326,7 +326,6 @@
 
 /*
  *  find chunk that represents a particular offset
- *  if off is negative, treat it as relative offset from the end
  *  a reference to the chunk is stored in *alcp
  *  the relative offset into the chunk is stored in *skipp
  *  return AL_OK and *alcp == NULL if positioned exactly to end of list
@@ -339,9 +338,6 @@
     size_t pos, end;
     size_t chunksize;
 
-    if (off < 0) /* off is negative */
-        off += al->bytes;
-
     if ((al->bytes / 2) >= off) { /* FIXME poor man's heuristic */
         /* forward search */
         pos = 0;

CVSTrac 2.0.1