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");
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);
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";
*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 {