* silenced more warnings
authorArt Cancro <ajc@citadel.org>
Wed, 18 Nov 2009 16:11:37 +0000 (16:11 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 18 Nov 2009 16:11:37 +0000 (16:11 +0000)
citadel/utils/chkpw.c
citadel/utils/sendcommand.c

index ce5faaff81d4db537a3141d66744564c5a5a3180..9adabaca500586db5243e8883d2a7ae5e0afd4af 100644 (file)
@@ -48,10 +48,11 @@ int chkpwd_read_pipe[2];
 static int validpw(uid_t uid, const char *pass)
 {
        char buf[256];
+       int rv;
 
-       write(chkpwd_write_pipe[1], &uid, sizeof(uid_t));
-       write(chkpwd_write_pipe[1], pass, 256);
-       read(chkpwd_read_pipe[0], buf, 4);
+       rv = write(chkpwd_write_pipe[1], &uid, sizeof(uid_t));
+       rv = write(chkpwd_write_pipe[1], pass, 256);
+       rv = read(chkpwd_read_pipe[0], buf, 4);
 
        if (!strncmp(buf, "PASS", 4)) {
                printf("pass\n");
@@ -109,6 +110,7 @@ int main(int argc, char **argv) {
        struct passwd *p;
        int uid;
        char ctdldir[PATH_MAX]=CTDLDIR;
+       char *ptr;
        
        calc_dirs_n_files(0,0,"", ctdldir, 0);
        
@@ -121,7 +123,7 @@ int main(int argc, char **argv) {
        }
        while(1) {
                printf("\n\nUsername: ");
-               fgets(buf, sizeof buf, stdin);
+               ptr = fgets(buf, sizeof buf, stdin);
                buf[strlen(buf)-1] = 0;
                p = getpwnam(buf);
                if (p == NULL) {
@@ -131,7 +133,7 @@ int main(int argc, char **argv) {
                        uid = p->pw_uid;
                        printf("     uid: %d\n", uid);
                        printf("Password: ");
-                       fgets(buf, sizeof buf, stdin);
+                       ptr = fgets(buf, sizeof buf, stdin);
                        buf[strlen(buf)-1] = 0;
                        validpw(uid, buf);
                }
index faeb469c1bc2ee273f1996867af849d7b27a67e4..8ea8fd633e97a7273530a86595992a6c63efd78e 100644 (file)
@@ -47,9 +47,10 @@ int set_lockfile(void)
 {
        FILE *lfp;
        int onppid;
+       int rv;
 
        if ((lfp = fopen(LOCKFILE, "r")) != NULL) {
-               fscanf(lfp, "%d", &onppid);
+               rv = fscanf(lfp, "%d", &onppid);
                fclose(lfp);
                if (!kill(onppid, 0) || errno == EPERM)
                        return 1;