try using --without-ipv6
[debian/amanda] / recover-src / display_commands.c
index 90e181674afc385ea96f3629be90ed1b72b12927..826c4ce3a5b8304336d16370f1ec931f9ce2443d 100644 (file)
@@ -143,6 +143,7 @@ suck_dir_list_from_server(void)
     char *disk_path_slash_dot = NULL;
     char *s;
     int ch;
+    char *qdisk_path;
 
     if (disk_path == NULL) {
        printf("Directory must be set before getting listing\n");
@@ -155,7 +156,9 @@ suck_dir_list_from_server(void)
 
     clear_dir_list();
 
-    cmd = stralloc2("OLSD ", disk_path);
+    qdisk_path = quote_string(disk_path);
+    cmd = stralloc2("OLSD ", qdisk_path);
+    amfree(qdisk_path);
     if (send_command(cmd) == -1) {
        amfree(cmd);
        amfree(disk_path_slash);
@@ -200,14 +203,12 @@ 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(l, "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";
@@ -236,12 +237,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 {