]> git.sur5r.net Git - cc65/blobdiff - libsrc/common/fgets.c
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / common / fgets.c
index ebfeb08662abe590c9f729229f6f4f13dd126ab6..e65fb4bc8e28ef0849a7acf03bc2a17167574b3c 100644 (file)
 
 char* __fastcall__ fgets (char* s, unsigned size, FILE* f)
 {
-    int i = 0;
+    unsigned i;
     int c;
 
     if (size == 0) {
         /* Invalid size */
-        _errno = EINVAL;
-        return 0;
+        return (char*) _seterrno (EINVAL);
     }
 
     /* Read input */