[augeas-devel] augeas: master - * tests/fatest.c (print_regerror): only print first 40 chars of regexp

David Lutterkort lutter at fedoraproject.org
Thu Oct 1 00:23:32 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=10a39c87340e907cccd0a80b0fe0adba3d959b97
Commit:        10a39c87340e907cccd0a80b0fe0adba3d959b97
Parent:        776a360dd8db2596ddf7174672cbc8ae2d4995f8
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Wed Sep 30 12:08:02 2009 -0700
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Wed Sep 30 17:07:54 2009 -0700

* tests/fatest.c (print_regerror): only print first 40 chars of regexp

---
 tests/fatest.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tests/fatest.c b/tests/fatest.c
index 34c8f2f..2a7e7c6 100644
--- a/tests/fatest.c
+++ b/tests/fatest.c
@@ -44,7 +44,13 @@ static void print_regerror(int err, const char *regexp) {
     size = regerror(err, NULL, NULL, 0);
     errbuf = alloca(size);
     regerror(err, NULL, errbuf, size);
-    fprintf(stderr, "Error building fa from %s:\n", regexp);
+    if (strlen(regexp) > 40) {
+        char *s = strndup(regexp, 40);
+        fprintf(stderr, "Error building fa from %s...:\n", s);
+        free(s);
+    } else {
+        fprintf(stderr, "Error building fa from %s:\n", regexp);
+    }
     fprintf(stderr, "  %s\n", errbuf);
 }
 




More information about the augeas-devel mailing list