]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/passdb: clang: Value stored to 'c' is never read
authorNoel Power <noel.power@suse.com>
Thu, 5 Sep 2019 14:42:41 +0000 (14:42 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 26 Sep 2019 18:41:28 +0000 (18:41 +0000)
source3/passdb/pdb_smbpasswd.c:405:4: warning: Value stored to 'c' is never read <--[clang]
                        c = '\0';
                        ^   ~~~~
/home/samba/samba/source3/passdb/pdb_smbpasswd.c:809:4: warning: Value stored to 'c' is never read <--[clang]
                        c = '\0';
                        ^   ~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/passdb/pdb_smbpasswd.c

index a9def1260d4ec93b697a1b433fce51769f791e15..bed3cea744ca75e2e440402dff2127808de9015f 100644 (file)
@@ -367,7 +367,6 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s
        unsigned char *smbpwd = smbpasswd_state->smbpwd;
        unsigned char *smbntpwd = smbpasswd_state->smbntpwd;
        char linebuf[256];
-       int c;
        unsigned char *p;
        long uidval;
        size_t linebuf_len;
@@ -402,8 +401,8 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s
                }
 
                if (linebuf[linebuf_len - 1] != '\n') {
-                       c = '\0';
                        while (!ferror(fp) && !feof(fp)) {
+                               int c;
                                c = fgetc(fp);
                                if (c == '\n') {
                                        break;
@@ -740,7 +739,6 @@ static bool mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con
 #define LINEBUF_SIZE 255
        char linebuf[LINEBUF_SIZE + 1];
        char readbuf[1024];
-       int c;
        char ascii_p16[FSTRING_LEN + 20];
        fstring encode_bits;
        unsigned char *p = NULL;
@@ -806,8 +804,8 @@ static bool mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con
                 */
                linebuf_len = strlen(linebuf);
                if (linebuf[linebuf_len - 1] != '\n') {
-                       c = '\0';
                        while (!ferror(fp) && !feof(fp)) {
+                               int c;
                                c = fgetc(fp);
                                if (c == '\n') {
                                        break;