]> code.citadel.org Git - citadel.git/blobdiff - citadel/userlist.c
* Changed a bunch of localtime() calls to localtime_r(), for great justice.
[citadel.git] / citadel / userlist.c
index 7df54c9e5ddeb32901e74e919cd05400cd0544a6..00534037d1a976634ae2fbc7586c05a321149917 100644 (file)
@@ -34,7 +34,7 @@ void logoff(int code)
 void userlist(CtdlIPC *ipc) { 
        char buf[SIZ];
        char fl[SIZ];
-       struct tm *tmbuf;
+       struct tm tmbuf;
        time_t lc;
        char *listing = NULL;
        int r;
@@ -54,11 +54,11 @@ void userlist(CtdlIPC *ipc) {
                printf("%5ld %d ",extract_long(buf,2),
                        extract_int(buf,1));
                lc = extract_long(buf,3);
-               tmbuf = (struct tm *)localtime(&lc);
+               localtime_r(&lc, &tmbuf);
                printf("%02d/%02d/%04d ",
-                       (tmbuf->tm_mon+1),
-                       tmbuf->tm_mday,
-                       (tmbuf->tm_year + 1900));
+                       (tmbuf.tm_mon+1),
+                       tmbuf.tm_mday,
+                       (tmbuf.tm_year + 1900));
                printf("%5ld %5ld\n",
                        extract_long(buf,4),extract_long(buf,5));
        }
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
        CtdlIPC *ipc = NULL;
 
        ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf);
-       CtdlIPC_getline(ipc, buf);
+       CtdlIPC_chat_recv(ipc, buf);
        if ((buf[0]!='2')&&(strncmp(buf,"551",3))) {
                fprintf(stderr,"%s: %s\n",argv[0],&buf[4]);
                logoff(atoi(buf));