MCPcopy Create free account
hub / github.com/NetHack/NetHack / xpmgetline

Function xpmgetline

outdated/win/gem/xpm2img.c:163–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161#define bufsz 2048
162char buf[bufsz];
163char *
164xpmgetline()
165{
166 char *bp;
167 do {
168 if (fgets(buf, bufsz, xpmfh) == 0)
169 return 0;
170 } while (buf[0] != '"');
171 /* strip off the trailing <",> if any */
172 for (bp = buf; *bp; bp++)
173 ;
174 bp--;
175 while (isspace(*bp))
176 bp--;
177 if (*bp == ',')
178 bp--;
179 if (*bp == '"')
180 bp--;
181 bp++;
182 *bp = '\0';
183 return &buf[1];
184}

Callers 3

mainFunction · 0.70
xpm2img.cFile · 0.70
xpm2iff.cFile · 0.50

Calls 2

fgetsFunction · 0.85
isspaceFunction · 0.85

Tested by

no test coverage detected