From: uz Date: Sun, 10 Jun 2012 18:25:22 +0000 (+0000) Subject: Shortened the code. X-Git-Tag: V2.14~367 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bfd0f586860607166ff1a51c1e6c0beb688bb272;p=cc65 Shortened the code. git-svn-id: svn://svn.cc65.org/cc65/trunk@5701 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/common/fdopen.c b/libsrc/common/fdopen.c index cfd649d75..fc8d0f776 100644 --- a/libsrc/common/fdopen.c +++ b/libsrc/common/fdopen.c @@ -21,18 +21,18 @@ FILE* __fastcall__ fdopen (int handle, const char* /*mode*/) { - FILE* f; + register FILE* f; /* Find a free file slot */ - if (!(f = _fdesc ())) { + if ((f = _fdesc ())) { + /* Insert the handle, and return the descriptor */ + f->f_fd = handle; + f->f_flags = _FOPEN; + } else { /* No slots */ - return (FILE*) _seterrno (EMFILE); /* Too many files */ + _seterrno (EMFILE); /* Too many files */ } - /* Insert the handle, and return the descriptor */ - f->f_fd = handle; - f->f_flags = _FOPEN; - /* Return the file descriptor */ return f; }