31 |
|
extern char *growInfo(int n); |
32 |
|
extern gethfunc headline; |
33 |
|
|
34 |
< |
#define add2info(s) strcpy(growInfo(strlen(s)), s) |
34 |
> |
#define add2info(s) {int _n=strlen(s); memcpy(growInfo(_n), s, _n+1);} |
35 |
|
#define clearInfo() growInfo(-infolen) |
36 |
|
|
37 |
|
RGBPRIMP rgbinp = stdprims; /* RGB input primitives */ |
289 |
|
void |
290 |
|
addBMPcspace(RGBPRIMP pp, double gamma) |
291 |
|
{ |
292 |
< |
char ibuf[128]; |
292 |
> |
char ibuf[196]; |
293 |
> |
char *cp = ibuf; |
294 |
|
|
295 |
+ |
sprintf(cp, "GAMMA=%.2f\n", gamma); |
296 |
+ |
cp += strlen(cp); |
297 |
|
if (pp != NULL) { |
298 |
< |
sprintf(ibuf, |
298 |
> |
sprintf(cp, |
299 |
|
"%s %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n", |
300 |
|
PRIMARYSTR, |
301 |
|
pp[RED][CIEX],pp[RED][CIEY], |
302 |
|
pp[GRN][CIEX],pp[GRN][CIEY], |
303 |
|
pp[BLU][CIEX],pp[BLU][CIEY], |
304 |
|
pp[WHT][CIEX],pp[WHT][CIEY]); |
305 |
< |
add2info(ibuf); |
305 |
> |
/* cp += strlen(cp); */ |
306 |
|
} |
304 |
– |
sprintf(ibuf, "GAMMA=%.2f\n", gamma); |
307 |
|
add2info(ibuf); |
308 |
|
} |
309 |
|
|
321 |
|
/* check for gamma */ |
322 |
|
if ((cp = strstr(infs, "GAMMA=")) != NULL) { |
323 |
|
/* copy what came before */ |
324 |
< |
fwrite(infs, cp-infs, 1, fout); |
324 |
> |
fwrite(infs, 1, cp-infs, fout); |
325 |
|
cp += 6; |
326 |
|
gamcor = atof(cp); /* record setting */ |
327 |
|
while (*cp++ != '\n') |