ensure NUL in ASCII and EBCDIC both always occurs ordinal 0

This commit is contained in:
tg 2017-05-03 17:51:06 +00:00
parent c03372e8a4
commit efa4d0d2cf
1 changed files with 5 additions and 1 deletions

6
shf.c
View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.92 2017/04/28 11:31:53 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.93 2017/05/03 17:51:06 tg Exp $");
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */
@ -1274,5 +1274,9 @@ ebcdic_init(void)
} else
ebcdic_map[i] = (unsigned short)(0x100U | ord(i));
}
if (ebcdic_rtt_toascii[0] || ebcdic_rtt_fromascii[0] || ebcdic_map[0]) {
write(2, "mksh: NUL not at position 0\n", 28);
exit(255);
}
}
#endif