Restore its ability to reject a string longer than will fit within size_t that was lost by moving away from strnlen(). Determine the length inline rather than using strlen(). Move it from hacklib.c to alloc.c so that utility programs have easy access, and remove the copy of it from dlb_main.c. Fix a logic bug in str_start_is(). If a string was considered to be too long, it exited the loop when n was 0 but also performed post-decrement. So after the loop, n would be -1 and the 'if (n==0)' test would fail. panic() would occur if the initial string matched and happened to be LARGEST_INT-1 characters long.
16 KiB
16 KiB