fix warning about signed vs. unsigned comparision and potential truncation error
This commit is contained in:
parent
4e0f597b5d
commit
5161342b9b
4
check.t
4
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.405 2011/02/03 15:57:49 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.406 2011/02/09 13:08:24 tg Exp $
|
||||||
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
||||||
@ -25,7 +25,7 @@
|
|||||||
# http://www.research.att.com/~gsf/public/ifs.sh
|
# http://www.research.att.com/~gsf/public/ifs.sh
|
||||||
|
|
||||||
expected-stdout:
|
expected-stdout:
|
||||||
@(#)MIRBSD KSH R39 2011/02/03
|
@(#)MIRBSD KSH R39 2011/02/09
|
||||||
description:
|
description:
|
||||||
Check version of shell.
|
Check version of shell.
|
||||||
stdin:
|
stdin:
|
||||||
|
15
histrap.c
15
histrap.c
@ -26,7 +26,7 @@
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.104 2011/01/30 02:18:20 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.105 2011/02/09 13:08:25 tg Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* MirOS: This is the default mapping type, and need not be specified.
|
* MirOS: This is the default mapping type, and need not be specified.
|
||||||
@ -274,9 +274,16 @@ c_fc(const char **wp)
|
|||||||
if (stat(tf->name, &statb) < 0)
|
if (stat(tf->name, &statb) < 0)
|
||||||
n = 128;
|
n = 128;
|
||||||
else {
|
else {
|
||||||
if (notoktoadd(statb.st_size, 1 + X_EXTRA)) {
|
unsigned long st_sizeUL;
|
||||||
bi_errorf(T_intovfl,
|
|
||||||
(unsigned long)statb.st_size, '+',
|
/* we pretty much assume ulong >= size_t */
|
||||||
|
st_sizeUL = (unsigned long)statb.st_size;
|
||||||
|
if (
|
||||||
|
/* too big, truncated by the cast */
|
||||||
|
statb.st_size != (long)st_sizeUL ||
|
||||||
|
/* a few additional bytes do not fit */
|
||||||
|
notoktoadd(st_sizeUL, 1 + X_EXTRA)) {
|
||||||
|
bi_errorf(T_intovfl, st_sizeUL, '+',
|
||||||
1UL + X_EXTRA);
|
1UL + X_EXTRA);
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
4
sh.h
4
sh.h
@ -154,9 +154,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERN
|
#ifdef EXTERN
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.427 2011/02/03 15:57:52 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.428 2011/02/09 13:08:27 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#define MKSH_VERSION "R39 2011/02/03"
|
#define MKSH_VERSION "R39 2011/02/09"
|
||||||
|
|
||||||
#ifndef MKSH_INCLUDES_ONLY
|
#ifndef MKSH_INCLUDES_ONLY
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user