* Append ID instead of prepending it
authorvolpol <volpol@packet-gain.de>
Fri, 15 Nov 2019 21:48:52 +0000 (22:48 +0100)
committervolpol <volpol@packet-gain.de>
Fri, 15 Nov 2019 21:51:09 +0000 (22:51 +0100)
So that LABEL sort order is perserved

riffx.c

diff --git a/riffx.c b/riffx.c
index 690c785f9372205e7800fcfc96c3a5765e3bddbf..f0d7de483bc1cc9d1afdbaacd060de591418b709 100644 (file)
--- a/riffx.c
+++ b/riffx.c
@@ -242,7 +242,7 @@ static inline int dump(const char *prefix, size_t id, const void *b, size_t len)
 
     /* Construct file name from prefix and label or id: */
     lab = cfg.use_label ? labl(b, len) : "";
-    snprintf(of, sizeof of, "%s%06zu%s%s%s", prefix, id, *lab?"_":"", lab, SUFFIX);
+    snprintf(of, sizeof of, "%s%s%s%06zu%s", prefix, lab, *lab?"_":"", id, SUFFIX);
     if (cfg.verbose)
         LOG(": %8zu -> %s\n", len, of);
     /* Caveat: This will overwrite any existing file with the same name! */