- for(f=0;f<(sizeof(snapshot_archives)/sizeof(*snapshot_archives));++f) {
- const struct snapshot_archive_t* sat = &snapshot_archives[f];
- if(! ( strncmp(sat->suffix,str,tl) && strncmp(sat->suffix+1,str,tl-1) ) ) {
+ for(f=0; f<snapshot_archives_len; f++) {
+ sat = &snapshot_archives[f];
+ sl = strlen(sat->suffix);
+ if((tl == sl && !strncmp(sat->suffix, str, tl)) ||
+ (tl == sl-1 && !strncmp(sat->suffix+1, str, tl-1))) {