CORD CORD_from_fn(CORD_fn fn, void * client_data, size_t len)
{
- if (len <= 0) return(0);
+ if (len == 0) return(0);
if (len <= SHORT_LIMIT) {
register char * result;
register size_t i;
{
register size_t len = CORD_len(x);
- if (i >= len || n <= 0) return(0);
- /* n < 0 is impossible in a correct C implementation, but */
- /* quite possible under SunOS 4.X. */
+ if (i >= len || n == 0) return(0);
if (i + n > len) n = len - i;
return(CORD_substr_checked(x, i, n));
}
if (!CORD_pos_valid(ypos)) {
return(1);
}
- if ((avail = CORD_pos_chars_left(xpos)) <= 0
- || (yavail = CORD_pos_chars_left(ypos)) <= 0) {
+ avail = CORD_pos_chars_left(xpos);
+ if (avail == 0
+ || (yavail = CORD_pos_chars_left(ypos)) == 0) {
register char xcurrent = CORD_pos_fetch(xpos);
register char ycurrent = CORD_pos_fetch(ypos);
if (xcurrent != ycurrent) return(xcurrent - ycurrent);