Commit 0f4f3c67 authored by Lucio De Re's avatar Lucio De Re Committed by Russ Cox

gc: avoid 0-length C array

R=golang-dev, ality
CC=golang-dev, rsc
https://golang.org/cl/5467066
parent 2c2a582a
......@@ -38,6 +38,7 @@ static struct {
int *val;
} exper[] = {
// {"rune32", &rune32},
{nil, nil},
};
static void
......@@ -45,7 +46,7 @@ addexp(char *s)
{
int i;
for(i=0; i<nelem(exper); i++) {
for(i=0; exper[i].name != nil; i++) {
if(strcmp(exper[i].name, s) == 0) {
*exper[i].val = 1;
return;
......@@ -75,7 +76,7 @@ expstring(void)
static char buf[512];
strcpy(buf, "X");
for(i=0; i<nelem(exper); i++)
for(i=0; exper[i].name != nil; i++)
if(*exper[i].val)
seprint(buf+strlen(buf), buf+sizeof buf, ",%s", exper[i].name);
if(strlen(buf) == 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment