]> granicus.if.org Git - graphviz/commitdiff
make nop usage string a constant array
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 29 May 2021 17:48:35 +0000 (10:48 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 5 Jun 2021 00:01:14 +0000 (17:01 -0700)
The compiler could probably determine this already, but this makes it a little
more obvious that it can be inlined and the useString symbol can be the start of
the data rather than a pointer to the start of the data.

cmd/tools/nop.c

index 0fc805c0ecf3ad66db7c4b57a7b5d8320743b275..1c3cee97ceec203b0f5cf5d5f9ed874b346bc51a 100644 (file)
@@ -23,7 +23,7 @@
 char **Files;
 int chkOnly;
 
-static char *useString = "Usage: nop [-p?] <files>\n\
+static const char useString[] = "Usage: nop [-p?] <files>\n\
   -p - check for valid DOT\n\
   -? - print usage\n\
 If no files are specified, stdin is used\n";