Imported Upstream version 2.5.2p1
[debian/amanda] / oldrecover-src / display_commands.c
index 0969a93285951d98d998211ceae8816a7f1c5591..2a15332542467451758063af10b632186495c6ba 100644 (file)
@@ -198,14 +198,13 @@ suck_dir_list_from_server(void)
            printf("%s\n", l);
            continue;
        }
-#define sc "201-"
-       if (strncmp(l, sc, sizeof(sc)-1) != 0) {
+       s = l;
+       if (strncmp_const_skip(s, "201-", s, ch) != 0) {
            err = "bad reply: not 201-";
            continue;
        }
-       s = l + sizeof(sc)-1;
        ch = *s++;
-#undef sc
+
        skip_whitespace(s, ch);
        if(ch == '\0') {
            err = "bad reply: missing date field";
@@ -234,12 +233,13 @@ suck_dir_list_from_server(void)
        *tape_undo = '\0';
 
        if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_OLSD)) {
+           OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
            skip_whitespace(s, ch);
-           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                                   (OFF_T_FMT_TYPE *)&fileno) != 1) {
+           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
                err = "bad reply: cannot parse fileno field";
                continue;
            }
+           fileno = (off_t)fileno_;
            skip_integer(s, ch);
        }
        else {