Browse code

fix problems with main.cvd building

git-svn: trunk@3132

Tomasz Kojm authored on 2007/07/11 07:36:34
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Jul 10 23:41:57 CEST 2007 (tk)
2
+----------------------------------
3
+  * sigtool/sigtool.c: fix problems with main.cvd building
4
+
1 5
 Tue Jul 10 23:06:14 CEST 2007 (tk)
2 6
 ----------------------------------
3 7
   * libclamav: improve handling of SFX CAB archives
... ...
@@ -628,7 +628,17 @@ static int build(struct optstruct *opt)
628 628
     if(!strcmp(dbname, "main")) {
629 629
 	fflush(stdin);
630 630
 	mprintf("Functionality level: ");
631
-	scanf("%u", &fl);
631
+	if(fgets(smbuff, sizeof(smbuff), stdin)) {
632
+	    cli_chomp(smbuff);
633
+	} else {
634
+	    mprintf("!build: Can't get functionality level\n");
635
+	    return -1;
636
+	}
637
+	fl = atoi(smbuff);
638
+	if(!fl || fl > 99) {
639
+	    mprintf("!build: Incorrect functionality level\n");
640
+	    return -1;
641
+	}
632 642
     } else {
633 643
 	fl = cl_retflevel();
634 644
     }
... ...
@@ -1465,7 +1475,7 @@ static int verifydiff(const char *diff, const char *cvd, const char *incdir)
1465 1465
 
1466 1466
     cvd ? (cpt = cvd) : (cpt = incdir);
1467 1467
 
1468
-    if(strstr(cpt, "main.cvd"))
1468
+    if(strstr(cpt, "main"))
1469 1469
 	strcpy(info, "main.info");
1470 1470
     else
1471 1471
 	strcpy(info, "daily.info");