mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-06 11:21:22 +02:00
44307: allow for atoi() returning a negative number
This commit is contained in:
parent
09917e558b
commit
3de2333b08
5 changed files with 12 additions and 6 deletions
|
@ -1,5 +1,8 @@
|
|||
2019-05-20 Oliver Kiddle <okiddle@yahoo.co.uk>
|
||||
|
||||
* 44307: Src/exec.c, Src/init.c, Src/params.c, Src/utils.c:
|
||||
allow for atoi() returning a negative number
|
||||
|
||||
* 44308: Completion/Linux/Command/_modutils: update Linux
|
||||
modutils completion
|
||||
|
||||
|
|
|
@ -2535,7 +2535,7 @@ setunderscore(char *str)
|
|||
{
|
||||
queue_signals();
|
||||
if (str && *str) {
|
||||
int l = strlen(str) + 1, nl = (l + 31) & ~31;
|
||||
size_t l = strlen(str) + 1, nl = (l + 31) & ~31;
|
||||
|
||||
if (nl > underscorelen || (underscorelen - nl) > 64) {
|
||||
zfree(zunderscore, underscorelen);
|
||||
|
|
|
@ -45,7 +45,10 @@ int noexitct = 0;
|
|||
char *zunderscore;
|
||||
|
||||
/**/
|
||||
int underscorelen, underscoreused;
|
||||
size_t underscorelen;
|
||||
|
||||
/**/
|
||||
int underscoreused;
|
||||
|
||||
/* what level of sourcing we are at */
|
||||
|
||||
|
|
|
@ -2201,10 +2201,10 @@ getstrvalue(Value v)
|
|||
|
||||
if (v->flags & VALFLAG_SUBST) {
|
||||
if (v->pm->node.flags & (PM_LEFT|PM_RIGHT_B|PM_RIGHT_Z)) {
|
||||
unsigned int fwidth = v->pm->width ? v->pm->width : MB_METASTRLEN(s);
|
||||
size_t fwidth = v->pm->width ? (unsigned int)v->pm->width : MB_METASTRLEN(s);
|
||||
switch (v->pm->node.flags & (PM_LEFT | PM_RIGHT_B | PM_RIGHT_Z)) {
|
||||
char *t, *tend;
|
||||
unsigned int t0;
|
||||
size_t t0;
|
||||
|
||||
case PM_LEFT:
|
||||
case PM_LEFT | PM_RIGHT_Z:
|
||||
|
@ -5858,7 +5858,7 @@ printparamnode(HashNode hn, int printflags)
|
|||
doneminus = 0;
|
||||
}
|
||||
if ((pmptr->flags & PMTF_USE_WIDTH) && p->width) {
|
||||
printf("%d ", p->width);
|
||||
printf("%u ", p->width);
|
||||
doneminus = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3336,7 +3336,7 @@ morefmt:
|
|||
case '.':
|
||||
{
|
||||
long fnsec = nsec;
|
||||
if (digs > 9)
|
||||
if (digs < 0 || digs > 9)
|
||||
digs = 9;
|
||||
if (ztrftimebuf(&bufsize, digs))
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue