5 ms·
size_t is also unsigned (no idea why). The signed equivalent is ssize_t. Edit: Sorry, missed the "i-- > 0" at first. The code works, but not because of changin
by ahomescu1 11y ago
size_t is also unsigned (no idea why). The signed equivalent is ssize_t.
Edit: Sorry, missed the "i-- > 0" at first. The code works, but not because of changing "unsigned" to "size_t".
- Peaker 11y agoSizes can be >2gb on a 32 bit system. Not sure how ssize_t works, is it 64 bits then? It makes sense to use unsigned for sizes to save a bit (or 32 bits per size). Also less invalid possible inputs to handle.
- MaulingMonkey 11y agoNo worries. I nearly left it "unsigned", but my OCD kicked in. Too many 64-bit conversion warnings stain my psyche...
- kazinator 11y agoBy the way, ssize_t is POSIX, from <sys/types.h>, not ISO C.