picoproj: issue a warning when passing "-f" more than once
authorAntonio Ospite <ospite@studenti.unina.it>
Thu, 10 May 2012 10:10:45 +0000 (12:10 +0200)
committerAntonio Ospite <ospite@studenti.unina.it>
Thu, 10 May 2012 13:58:00 +0000 (15:58 +0200)
examples/picoproj.c

index a44a266..e18cc7d 100644 (file)
@@ -74,6 +74,8 @@ int main(int argc, char *argv[])
        while ((opt = getopt(argc, argv, "f:F:l:p:W:H:h")) != -1) {
                switch (opt) {
                case 'f':
        while ((opt = getopt(argc, argv, "f:F:l:p:W:H:h")) != -1) {
                switch (opt) {
                case 'f':
+                       if (filename[0] != '\0')
+                               fprintf(stderr, "Warning: image file already specified\n");
                        strncpy(filename, optarg, FILENAME_MAX);
                        break;
                case 'F':
                        strncpy(filename, optarg, FILENAME_MAX);
                        break;
                case 'F':