summaryrefslogtreecommitdiffstats
path: root/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-08-27 13:56:24 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-08-27 14:03:20 -0400
commitc6cf5ec6ae6420e902441289a5b7524a2322a664 (patch)
tree537a21dd534b83948b7e0de38e90ebf2f2fdb95e /color.c
parent8a9b6497167626e768cab063e9d6c381523b3244 (diff)
downloadbfs-c6cf5ec6ae6420e902441289a5b7524a2322a664.tar.xz
Implement cost-based optimization
Diffstat (limited to 'color.c')
-rw-r--r--color.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/color.c b/color.c
index 1b6b539..031741d 100644
--- a/color.c
+++ b/color.c
@@ -495,12 +495,28 @@ int cfprintf(CFILE *cfile, const char *format, ...) {
}
break;
+ case 'g':
+ if (fprintf(file, "%g", va_arg(args, double)) < 0) {
+ goto done;
+ }
+ break;
+
case 's':
if (fputs(va_arg(args, const char *), file) == EOF) {
goto done;
}
break;
+ case 'z':
+ ++i;
+ if (*i != 'u') {
+ goto invalid;
+ }
+ if (fprintf(file, "%zu", va_arg(args, size_t)) < 0) {
+ goto done;
+ }
+ break;
+
case 'P':
if (print_path(cfile, va_arg(args, const struct BFTW *)) != 0) {
goto done;