Skip to content

Commit

Permalink
[c86 libc] Ensure no data has address zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Jan 1, 2025
1 parent a0dca9c commit caee800
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion libc/c86/syscall.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use16 86

.data
.sect 1 ; first data seg
dw 0,0 ; prevent data having address 0
.data ; default data seg 3
.align 2
.comm _errno,2
.comm _environ,2
Expand Down
2 changes: 0 additions & 2 deletions libc/stdio/vfprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,7 @@ vfprintf(FILE *op, const char *fmt, va_list ap)

case 's': /* String */
p = va_arg(ap, char *);
#ifndef __C86__ /* FIXME add 4 bytes nullptr at start of .data */
if (!p) p = "(null)";
#endif
nopad:
sign = '\0';
pad = ' ';
Expand Down

0 comments on commit caee800

Please sign in to comment.