dtcm: Coverity 88069
authorPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 18:16:00 +0000 (19:16 +0100)
committerPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 18:16:00 +0000 (19:16 +0100)
cde/programs/dtcm/dtcm/timezone.c

index e7dfa4a156bfeaf8f220003a671df5c81e6a855b..09799084683daad0e087eca2c8fe7e108f6daacd 100644 (file)
@@ -68,7 +68,7 @@ make_timezone(Calendar *c)
        XmString xmstr;
        int ac;
        Arg args[10];
-       char buf[BUFSIZ], tmp_buf[BUFSIZ];
+       char buf[BUFSIZ], tmp_buf[BUFSIZ] = "";
        char *title;
        void tz_customtime_cb(), tz_mytime_cb(), 
                        tz_apply_cb(), tz_cancel_cb(), tz_ok_cb();
@@ -296,8 +296,7 @@ make_timezone(Calendar *c)
        cm_strcpy(t->gmttimezone, "");
        cm_strcpy(t->mytimezone, "US/Pacific");
        cm_strcpy(tmp_buf, (char*)getenv("TZ"));
-       if (tmp_buf)
-               cm_strcpy(t->mytimezone, tmp_buf);
+       cm_strcpy(t->mytimezone, tmp_buf);
 
        sprintf(buf, "%s %s", catgets(c->DT_catd, 1, 659, "Time Zone:"),
                t->mytimezone);