]> git.webhop.me Git - tuxwetter.git/commitdiff
tuxwetter.c: fix possible format overflow
authorThilo Graf <dbt@novatux.de>
Sat, 10 Mar 2018 15:49:41 +0000 (16:49 +0100)
committerThilo Graf <dbt@novatux.de>
Sat, 10 Mar 2018 15:49:41 +0000 (16:49 +0100)
tuxwetter.c

index 413c89209812bce9f7f7db11a7d4513c711fec8c..60e73cd61e07e64618f9dccbfb6737fe54732fd8 100644 (file)
@@ -527,7 +527,7 @@ struct tm *tltime;
                                        fcnt++;
                                        tptr++;
                                }
-                               sprintf(fstr,"%%0%dd",fcnt);
+                               snprintf(fstr, sizeof(fstr), "%%0%dd", fcnt);
                                switch(*cptr)
                                {
                                        case 'Y':