AmendHub

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 67 about 1 year ago

util: Reduce data section where we can

jcs made amendment 66 about 1 year ago

Amendments on November 21, 2024

util: Do an initial xorshift32 at util_init time

jcs made amendment 51 about 1 year ago

Amendments on November 15, 2024


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.
jcs made amendment 31 about 1 year ago

Amendments on November 3, 2024


Amendments on October 1, 2024

util: Avoid a redraw on an existing progress dialog

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 4 about 1 year ago

*: Initial import, part 2

jcs made amendment 2 about 1 year ago