MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / stbi__pnm_getinteger

Function stbi__pnm_getinteger

Source/Utils/stb_image.h:7564–7576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7562}
7563
7564static int stbi__pnm_getinteger(stbi__context *s, char *c)
7565{
7566 int value = 0;
7567
7568 while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
7569 value = value*10 + (*c - '0');
7570 *c = (char) stbi__get8(s);
7571 if((value > 214748364) || (value == 214748364 && *c > '7'))
7572 return stbi__err("integer parse overflow", "Parsing an integer in the PPM header overflowed a 32-bit int");
7573 }
7574
7575 return value;
7576}
7577
7578static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
7579{

Callers 1

stbi__pnm_infoFunction · 0.85

Calls 4

stbi__at_eofFunction · 0.85
stbi__pnm_isdigitFunction · 0.85
stbi__get8Function · 0.85
stbi__errFunction · 0.85

Tested by

no test coverage detected