projects
/
riffx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cbb162b
)
* Fix off-by-one in filename generation.
master
author
Urban Wallasch
<urban.wallasch@freenet.de>
Sat, 6 Jun 2020 10:54:04 +0000
(12:54 +0200)
committer
Urban Wallasch
<urban.wallasch@freenet.de>
Sat, 6 Jun 2020 10:54:04 +0000
(12:54 +0200)
riffx.c
patch
|
blob
|
history
diff --git
a/riffx.c
b/riffx.c
index d71ae66bb4fa1729c52b1873aa5ee6b3f20c2de0..6533f899203c338d6bd84a43aaed7ddf5f759092 100644
(file)
--- a/
riffx.c
+++ b/
riffx.c
@@
-363,16
+363,16
@@
int main(int argc, char *argv[]) {
*x = 0;
if (cfg.use_basename) {
x = strrchr(tfn, '/');
*x = 0;
if (cfg.use_basename) {
x = strrchr(tfn, '/');
- x = x ? x : tfn;
+ x = x ? x
+ 1
: tfn;
n = snprintf(fpfx, sizeof fpfx, "%s/%03d_%s_", odir, i - argidx, x);
}
else {
n = snprintf(fpfx, sizeof fpfx, "%s/%s/", odir, tfn);
}
n = snprintf(fpfx, sizeof fpfx, "%s/%03d_%s_", odir, i - argidx, x);
}
else {
n = snprintf(fpfx, sizeof fpfx, "%s/%s/", odir, tfn);
}
- if ( (size_t)n >= sizeof fpfx ) {
- LOG("output directory path truncated: '%s'\n", fpfx);
- exit(EXIT_FAILURE);
- }
+
if ( (size_t)n >= sizeof fpfx ) {
+
LOG("output directory path truncated: '%s'\n", fpfx);
+
exit(EXIT_FAILURE);
+
}
if (!cfg.use_basename)
mkdirp(fpfx, 0755);
LOG("Dumping to %s...\n", fpfx);
if (!cfg.use_basename)
mkdirp(fpfx, 0755);
LOG("Dumping to %s...\n", fpfx);