From 96619efc96a6e9e0cc5f5de260e6b1be3c263601 Mon Sep 17 00:00:00 2001 From: Sergey Dorofeev Date: Wed, 29 Feb 2012 21:38:43 +0400 Subject: [PATCH] slash checking in binkp --- source/bforce/prot_binkp_misc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/bforce/prot_binkp_misc.c b/source/bforce/prot_binkp_misc.c index 9bc77bc..1d2b19c 100644 --- a/source/bforce/prot_binkp_misc.c +++ b/source/bforce/prot_binkp_misc.c @@ -39,12 +39,23 @@ int binkp_parsfinfo(const char *str, s_bpfinfo *fi, bool with_offset) { int r; + char *chkslash; if( strlen(str)>PATH_MAX ) { log("too long string, overflow may occur"); return -1; } log("info to parse: %s", str); r = sscanf(str, with_offset? "%s %d %d %d": "%s %d %d", &fi->fn, &fi->sz, &fi->tm, &fi->offs); + chkslash = fi->fn; + while (1) { + chkslash = strchr(chkslash, '/'); + if (chkslash) { + *chkslash = '_'; + } + else { + break; + } + } if (r==(with_offset? 4: 3)) { return 0; }