the expression -off is not safe in case off is the most-negative
value. instead apply - to base which is known to be non-negative and
bounded within sanity.
errno = EINVAL;
return -1;
}
errno = EINVAL;
return -1;
}
- if (-off > base || off > SSIZE_MAX-base) goto fail;
+ if (off < -base || off > SSIZE_MAX-base) goto fail;
return c->pos = base+off;
}
return c->pos = base+off;
}
errno = EINVAL;
return -1;
}
errno = EINVAL;
return -1;
}
- if (-off > base || off > SSIZE_MAX/4-base) goto fail;
+ if (off < -base || off > SSIZE_MAX/4-base) goto fail;
memset(&c->mbs, 0, sizeof c->mbs);
return c->pos = base+off;
}
memset(&c->mbs, 0, sizeof c->mbs);
return c->pos = base+off;
}