jcs
/detritus
/amendments
/util.c
Amendments on December 27, 2024
util: Add strcaseidx
When trying to case-insensitively match a string to a list of char
pointers, having to call into strcasecmp for every list entry and
start the indexing into the string over again every time is quite
expensive.
strcaseidx takes a string and a pointer to an array of char pointers
and walks the list and indexes the string only once, advancing
through the list as each next character matches or not. This
requires the list to be sorted.
jcs made amendment
66
about 1 year ago
Amendments on November 21, 2024
jcs made amendment
51
about 1 year ago
Amendments on November 15, 2024
jcs made amendment
38
about 1 year ago
Amendments on November 11, 2024
util: Fix snprintf not truncating when the format string is too long
We were correctly stopping when the resulting buffer was becoming
longer than size, but if the input format string was longer than the
size, it was incorrectly copying the whole thing. This wasn't much
of a problem since passing a user-supplied format is dangerous anyway
but this needed fixing.
Since we weren't using vfprintf, drop the FILE mechanism and
implement bounds checking directly in vsnprintf. This is easier to
understand and may be a tad more performant.
Amendments on November 3, 2024
jcs made amendment
18
about 1 year ago
Amendments on October 1, 2024
jcs made amendment
5
about 1 year ago
Amendments on September 30, 2024
client: Use progress windows for connection sequence
Change cursor in progress() appropriately
jcs made amendment
2
about 1 year ago
1