]> sigrok.org Git - libsigrokdecode.git/commitdiff
type_decoder: eliminate explicit string length spec for literals
authorGerhard Sittig <redacted>
Sat, 25 Dec 2021 18:53:11 +0000 (19:53 +0100)
committerGerhard Sittig <redacted>
Sun, 26 Dec 2021 12:45:09 +0000 (13:45 +0100)
Rephrase the 'names[]' array declaration in output_type_name() to avoid
the necessity of guessing what the maximum length of the literals might
be during future maintenance. Developers need not care when the compiler
can handle this detail.

type_decoder.c

index 38e0a036c4bdba081b6e4e8c95aec50f4063393f..0a92a45df7b1510c98ede2c226779cf8d667c435 100644 (file)
@@ -33,7 +33,7 @@ typedef struct {
 /* This is only used for nicer srd_dbg() output. */
 SRD_PRIV const char *output_type_name(unsigned int idx)
 {
-       static const char names[][16] = {
+       static const char *names[] = {
                "OUTPUT_ANN",
                "OUTPUT_PYTHON",
                "OUTPUT_BINARY",