if (np > 0){
/* figure out the size needed */
if (fill >= 0){/* poly*/
- ret += sprintf(buf, " c %d -%s C %d -%s P %d ",(int) strlen(cstring), cstring, (int) strlen(cstring), cstring, np);
+ ret += snprintf(buf, sizeof(buf), " c %d -%s C %d -%s P %d ",(int) strlen(cstring), cstring, (int) strlen(cstring), cstring, np);
} else {/* line*/
assert(line_width >= 0);
if (line_width > 0){
sprintf(swidth,"%f",line_width);
len_swidth = strlen(swidth);
sprintf(swidth,"S %d -setlinewidth(%f)",len_swidth+14, line_width);
- ret += sprintf(buf, " c %d -%s %s L %d ",(int) strlen(cstring), cstring, swidth, np);
+ ret += snprintf(buf, sizeof(buf), " c %d -%s %s L %d ",(int) strlen(cstring), cstring, swidth, np);
} else {
- ret += sprintf(buf, " c %d -%s L %d ",(int) strlen(cstring), cstring, np);
+ ret += snprintf(buf, sizeof(buf), " c %d -%s L %d ",(int) strlen(cstring), cstring, np);
}
}
for (i = 0; i < np; i++){