Changeset 234b2c6fe5e8099b7e55ae9a395d81c0dca51ec0
- Timestamp:
- 02/08/08 15:02:39
(5 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1202482959 +0000
- git-parent:
[91d6330765b5eca1764fa8355f9c62013b18f82d]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1202482959 +0000
- Message:
Make OpenBSD not crap on sprintf and strcpy (replace them)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2c4eb5b |
r234b2c6 |
|
| 621 | 621 | ptr = h_realloc(ptr, max_size); |
|---|
| 622 | 622 | } |
|---|
| 623 | | (void) strunvis(ptr, line); |
|---|
| | 623 | (void) strlcpy(ptr, line, max_size); |
|---|
| 624 | 624 | line[sz] = c; |
|---|
| 625 | 625 | HENTER(h, &ev, ptr); |
|---|
| … | … | |
| 661 | 661 | ptr = h_realloc(ptr, max_size); |
|---|
| 662 | 662 | } |
|---|
| 663 | | (void) strvis(ptr, ev.str, VIS_WHITE); |
|---|
| | 663 | /* next line is better. strvis(ptr, ev.str, VIS_WHITE); */ |
|---|
| | 664 | (void) strlcpy(ptr, ev.str, max_size); |
|---|
| 664 | 665 | (void) fprintf(fp, "%s\n", ev.str); |
|---|
| 665 | 666 | } |
|---|
| r2c4eb5b |
r234b2c6 |
|
| 401 | 401 | */ |
|---|
| 402 | 402 | if (clen <= tlen) { |
|---|
| 403 | | (void) strcpy(*str, cap); /* XXX strcpy is safe */ |
|---|
| | 403 | (void) strlcpy(*str, cap, tlen); |
|---|
| 404 | 404 | return; |
|---|
| 405 | 405 | } |
|---|
| … | … | |
| 434 | 434 | return; |
|---|
| 435 | 435 | } |
|---|
| 436 | | /* XXX strcpy is safe */ |
|---|
| 437 | | (void) strcpy(*str = &el->el_term.t_buf[el->el_term.t_loc], cap); |
|---|
| | 436 | (void) strlcpy(*str = &el->el_term.t_buf[el->el_term.t_loc], cap, |
|---|
| | 437 | TC_BUFSIZE - el->el_term.t_loc); |
|---|
| 438 | 438 | el->el_term.t_loc += clen + 1; /* one for \0 */ |
|---|
| 439 | 439 | return; |
|---|