diff options
-rw-r--r-- | libq/atom.c | 3 | ||||
-rw-r--r-- | qatom.c | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libq/atom.c b/libq/atom.c index 5627415..ae781a8 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -645,8 +645,7 @@ atom_format_r( while (*p != '\0') { fmt = strchr(p, '%'); if (fmt == NULL) { - if (buflen > 0) - *buf = '\0'; + append_buf(buf, buflen, "%s", p); return buf; } else if (fmt != p) { append_buf(buf, buflen, "%.*s", (int)(fmt - p), p); @@ -4,6 +4,7 @@ * * Copyright 2005-2008 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2014 Mike Frysinger - <vapier@gentoo.org> + * Copyright 2018- Fabian Groffen - <grobian@gentoo.org> */ #include "main.h" @@ -41,9 +42,9 @@ int qatom_main(int argc, char **argv) while ((i = GETOPT_LONG(QATOM, qatom, "")) != -1) { switch (i) { - case 'F': format = optarg; break; + case 'F': format = optarg; break; case 'c': action = _COMPARE; break; - case 'p': action = _PRINT; break; + case 'p': action = _PRINT; break; COMMON_GETOPTS_CASES(qatom) } } |