From: Matthew Fernandez Date: Thu, 3 Nov 2022 02:25:13 +0000 (-0700) Subject: smyrna: remove 'line' shadowing in 'load_attr_list' X-Git-Tag: 7.0.1~5^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b841e11612d49e5502798d6972f1c1c5548895ae;p=graphviz smyrna: remove 'line' shadowing in 'load_attr_list' Squashes a compiler warning: gui/frmobjectui.c:580:10: warning: declaration of ‘line’ shadows a global declaration [-Wshadow] 580 | char line[BUFSIZ]; | ^~~~ In file included from ./smyrnadefs.h:27, from gui/gui.h:13, from gui/frmobjectui.c:15: ../../lib/glcomp/glutils.h:25:7: note: shadowed declaration is here 25 | } line; | ^~~~ --- diff --git a/cmd/smyrna/gui/frmobjectui.c b/cmd/smyrna/gui/frmobjectui.c index e267c6f0d..d8f2baa3d 100644 --- a/cmd/smyrna/gui/frmobjectui.c +++ b/cmd/smyrna/gui/frmobjectui.c @@ -577,7 +577,7 @@ attr_list *load_attr_list(Agraph_t * g) attr_list *l; FILE *file; Agsym_t *sym; /*cgraph atttribute */ - char line[BUFSIZ]; + char buffer[BUFSIZ]; static char *smyrna_attrs; char *a; @@ -588,10 +588,10 @@ attr_list *load_attr_list(Agraph_t * g) file = fopen(smyrna_attrs, "r"); if (file != NULL) { int i = 0; - while (fgets(line, BUFSIZ, file) != NULL) { + while (fgets(buffer, sizeof(buffer), file) != NULL) { int idx = 0; attr = new_attr(); - a = strtok(line, ","); + a = strtok(buffer, ","); attr->index = i; attr->type = get_attr_data_type(a[0]); while ((a = strtok(NULL, ","))) {