X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=oldrecover-src%2Fdisplay_commands.c;fp=oldrecover-src%2Fdisplay_commands.c;h=2a15332542467451758063af10b632186495c6ba;hb=d3b2175e084f88c8736ad7073eacbf4670147aec;hp=0969a93285951d98d998211ceae8816a7f1c5591;hpb=34197d9f46a5f4e944378cbb65fca32ee0eec7b9;p=debian%2Famanda diff --git a/oldrecover-src/display_commands.c b/oldrecover-src/display_commands.c index 0969a93..2a15332 100644 --- a/oldrecover-src/display_commands.c +++ b/oldrecover-src/display_commands.c @@ -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 {