* file named AUTHORS, in the root directory of this distribution.
*/
/*
- * $Id: extract_list.c,v 1.6.2.1 2006/11/08 17:11:39 martinea Exp $
+ * $Id: extract_list.c,v 1.6 2006/08/24 01:57:15 paddy_s Exp $
*
* implements the "extract" command in amrecover
*/
puts(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";
s[-1] = (char)ch;
if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
+ 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 *)&lditem.fileno) != 1) {
+ if(ch == '\0' ||
+ sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
err = "bad reply: cannot parse fileno field";
continue;
}
+ lditem.fileno = (off_t)fileno_;
skip_integer(s, ch);
}
puts(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";
*tape_undo = '\0';
if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
+ 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);
}