[Forensics-changes] [yara] 77/160: Simplify code and avoid exceeding the 80 characters per line limit

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:29:20 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.4.0
in repository yara.

commit 92827d5eb76bccd1d3bc97370c4dc0e2c2b6879e
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Thu Apr 16 09:11:54 2015 +0200

    Simplify code and avoid exceeding the 80 characters per line limit
---
 libyara/object.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libyara/object.c b/libyara/object.c
index 9066917..38a3122 100644
--- a/libyara/object.c
+++ b/libyara/object.c
@@ -1100,15 +1100,17 @@ void yr_object_print_data(
             "%s%s = \"",
             indent_spaces,
             object->identifier);
+
         for (int i = 0; i < ((YR_OBJECT_STRING*) object)->value->length; i++)
         {
-          if (isprint(((YR_OBJECT_STRING*) object)->value->c_string[i]))
-            printf("%c",
-                ((YR_OBJECT_STRING*) object)->value->c_string[i]);
+          char c = ((YR_OBJECT_STRING*) object)->value->c_string[i];
+
+          if (isprint(c))
+            printf("%c", c);
           else
-            printf("\\x%02x",
-                (unsigned char) ((YR_OBJECT_STRING*) object)->value->c_string[i]);
+            printf("\\x%02x", (unsigned char) c);
         }
+
         printf("\"\n");
       }
       break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list