So for some more annoyance i'll also post the review tweaks.
Brings some consistency and avoids a uselessly large buffer.
Everything in the Public Domain, of course.
Ciao,

--steffen
commit b3f543a09f987abacbd13b590cb6b5d1a342c650
Author: Steffen Nurpmeso <sdao...@users.sf.net>
Date:   2014-07-28 17:46:27 +0200

    file_case review tweaks (Public Domain)
---
 src/libs/libgroff/file_case.cpp | 4 ++--
 src/preproc/tbl/main.cpp        | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/libs/libgroff/file_case.cpp b/src/libs/libgroff/file_case.cpp
index 0b85a79..f00ce76 100644
--- a/src/libs/libgroff/file_case.cpp
+++ b/src/libs/libgroff/file_case.cpp
@@ -137,7 +137,7 @@ static bool
 _try_all_ext(args *ap)
 {
   for (zproc const *zp = _zprocs; zp < _zprocs + NELEM(_zprocs); ++zp) {
-    char *np = new char[zp->zp_cmd_len +1+ ap->a_path_len + zp->zp_ext_len +1];
+    char *np = new char[ap->a_path_len + zp->zp_ext_len +1];
 
     memcpy(np, ap->a_path, ap->a_path_len);
 
@@ -204,7 +204,7 @@ __run_zproc(args *ap, zproc const *zp)
 static args *
 __unpack(args *ap)
 {
-  size_t const buf_len = (BUFSIZ + 0) > 1 << 15 ? BUFSIZ : 1 << 15;
+  size_t const buf_len = (BUFSIZ + 0 > 1 << 15) ? BUFSIZ : 1 << 15;
   uint8_t *buf = new uint8_t[buf_len];
 
   // xtmpfile uses binary mode and fatal()s on error
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index 345f266..e968b98 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -1608,8 +1608,10 @@ int main(int argc, char **argv)
     if ((current_filename = argv[optind++]) == NULL)
       current_filename = "-";
     fcp = file_case::muxer(current_filename);
-    if (fcp == NULL)
+    if (fcp == NULL) {
+      assert(strcmp(current_filename, "-"));
       fatal("can't open `%1': %2", current_filename, strerror(errno));
+    }
 
     current_lineno = 1;
     printf(".lf 1 %s\n", current_filename);

Reply via email to