]> git.sur5r.net Git - cc65/commitdiff
Call _seterrno instead of assigning to _errno to make the code shorter.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 3 Jun 2010 20:21:23 +0000 (20:21 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 3 Jun 2010 20:21:23 +0000 (20:21 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4690 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/fgets.c

index ab755616a49990cfd3dd0e66f1e4105c63a3dffc..e65fb4bc8e28ef0849a7acf03bc2a17167574b3c 100644 (file)
@@ -25,8 +25,7 @@ char* __fastcall__ fgets (char* s, unsigned size, FILE* f)
 
     if (size == 0) {
         /* Invalid size */
-        _errno = EINVAL;
-        return 0;
+        return (char*) _seterrno (EINVAL);
     }
 
     /* Read input */