Re: [cc65] fd to IOCB bug, close not recycling IOCBs

From: Christian Groessler <chris1groessler.org>
Date: 2014-08-14 14:26:42
On 08/14/14 06:02, Thom Cherryhomes wrote:
> I have managed to side-step this for weeks now, but I need to either
> figure out if:
>
> (1) this is a problem I am doing, not using something correctly, OR
> (2) this is a problem that someone (myself included) needs to fix in
> the standard libs for atari.


I'm picking (1)


Try this:

diff --git a/user/src/user.c b/user/src/user.c
index b680974..2a5b09b 100644
--- a/user/src/user.c
+++ b/user/src/user.c
@@ -92,12 +92,15 @@ unsigned char user_add(UserRecord* record)
    if (!datfp || !idxfp)
      {
        // Couldn't open files
+       if (datfp) fclose(datfp);
        return FALSE;
      }

    if (user_lookup(record->username,lookup) == TRUE)
      {
        // User exists.
+      fclose(datfp);
+      fclose(idxfp);
        return FALSE;
      }



regards,
chris

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Aug 14 14:27:06 2014

This archive was generated by hypermail 2.1.8 : 2014-08-14 14:27:08 CEST