]> andersk Git - splint.git/blobdiff - src/inputStream.c
Fixed previously ignored splintme warnings in loopHeuristics.c
[splint.git] / src / inputStream.c
index 95b102afdfc33aeb6b9ca42c8448ba156e231e0d..95c1323462087e9341495061af323d538928bb19 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
@@ -203,7 +203,7 @@ extern /*@dependent@*/ /*@null@*/
 char *inputStream_nextLine (inputStream s)
 {
   char *currentLine;
-  int len;
+  size_t len;
 
   llassert (inputStream_isDefined (s));
   llassert (s->curLine == NULL);
@@ -226,15 +226,15 @@ char *inputStream_nextLine (inputStream s)
              c = strchr (s->stringSourceTail, '\0');
            }
 
-         len = c - s->stringSourceTail + 1;
+         len = size_fromInt (c - s->stringSourceTail + 1);
 
-         if (len > STUBMAXRECORDSIZE - 2)
+         if (len > size_fromInt (STUBMAXRECORDSIZE - 2))
            {
-             len = (STUBMAXRECORDSIZE - 2);
+             len = size_fromInt (STUBMAXRECORDSIZE - 2);
            }
 
          currentLine = &(s->buffer)[0];
-         strncpy (currentLine, s->stringSourceTail, size_fromInt (len));
+         strncpy (currentLine, s->stringSourceTail, len);
          currentLine[len] = '\0';
          s->stringSourceTail += len;
          /*@noaccess cstring@*/
@@ -260,7 +260,7 @@ char *inputStream_nextLine (inputStream s)
        }
       else 
        {
-         if (len >= STUBMAXRECORDSIZE - 2)
+         if (len >= size_fromInt (STUBMAXRECORDSIZE - 2))
            {
              lldiagmsg (message ("Input line too long: %s",
                                  cstring_fromChars (currentLine)));
This page took 0.033775 seconds and 4 git commands to generate.