FreeBSD Bugzilla – Attachment 11716 Details for
Bug 22965
[MFC] [PATCH] fix for minor bug in libc/gen/getcap.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.83 KB, created by
Garance A Drosehn
on 2000-11-20 00:00:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Garance A Drosehn
Created:
2000-11-20 00:00:01 UTC
Size:
1.83 KB
patch
obsolete
>Index: getcap.c >=================================================================== >RCS file: /home/ncvs/src/lib/libc/gen/getcap.c,v >retrieving revision 1.12 >diff -u -r1.12 getcap.c >--- getcap.c 2000/05/21 02:55:09 1.12 >+++ getcap.c 2000/11/19 23:09:15 >@@ -62,9 +62,9 @@ > #define TCERR (char)1 > #define SHADOW (char)2 > >-static size_t topreclen; /* toprec length */ >-static char *toprec; /* Additional record specified by cgetset() */ >-static int gottoprec; /* Flag indicating retrieval of toprecord */ >+static size_t topreclen = 0; /* toprec length */ >+static char *toprec = NULL; /* Additional record specified by cgetset() */ >+static int gottoprec = 0; /* Flag indicating retrieval of toprecord */ > > static int cdbget __P((DB *, char **, char *)); > static int getent __P((char **, u_int *, char **, int, char *, int, char *)); >@@ -619,9 +619,9 @@ > return (cgetnext(buf, db_array)); > } > >-static FILE *pfp; >-static int slash; >-static char **dbp; >+static FILE *pfp = NULL; >+static int slash = 0; /* on if last line read-in ended with a '/' */ >+static char **dbp = NULL; > > int > cgetclose() >@@ -647,7 +647,7 @@ > char **db_array; > { > size_t len; >- int status, i, done; >+ int done, fcloseres, i, status; > char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; > u_int dummy; > >@@ -665,8 +665,9 @@ > } else { > line = fgetln(pfp, &len); > if (line == NULL && pfp) { >- (void)fclose(pfp); >- if (ferror(pfp)) { >+ fcloseres = fclose(pfp); >+ pfp = NULL; >+ if (fcloseres != 0) { > (void)cgetclose(); > return (-1); > } else { >@@ -724,8 +725,9 @@ > } else { /* name field extends beyond the line */ > line = fgetln(pfp, &len); > if (line == NULL && pfp) { >- (void)fclose(pfp); >- if (ferror(pfp)) { >+ fcloseres = fclose(pfp); >+ pfp = NULL; >+ if (fcloseres != 0) { > (void)cgetclose(); > return (-1); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22965
: 11716