Fix issues found by Clang

These were int => size_t changes that shouldn't have been made
because the value of the variable can be negative.
This commit is contained in:
Andrew Johnson
2014-07-12 01:09:36 -05:00
parent 05367f1b33
commit c91fe7b7d7
2 changed files with 7 additions and 5 deletions

View File

@@ -315,9 +315,9 @@ static int db_yyinput(char *buf, int max_size)
fgetsRtn = fgets(mac_input_buffer,MY_BUFFER_SIZE,
pinputFileNow->fp);
if(fgetsRtn) {
n = macExpandString(macHandle,mac_input_buffer,
int exp = macExpandString(macHandle,mac_input_buffer,
my_buffer,MY_BUFFER_SIZE);
if(n<0) {
if(exp < 0) {
errPrintf(0,__FILE__, __LINE__,
"macExpandString failed for file %s",
pinputFileNow->filename);

View File

@@ -2093,7 +2093,6 @@ long dbPutString(DBENTRY *pdbentry,const char *pstring)
DBLINK *plink;
char string[80];
char *pstr = string;
size_t ind;
if (!pfield)
return S_dbLib_fieldNotFound;
@@ -2128,11 +2127,14 @@ long dbPutString(DBENTRY *pdbentry,const char *pstring)
/* Strip leading blanks and tabs */
while (*pstr && (*pstr == ' ' || *pstr == '\t')) pstr++;
/* Strip trailing blanks and tabs */
if (pstr)
for (ind = strlen(pstr) - 1; ind >= 0; ind--) {
if (pstr) {
int ind;
for (ind = (int) strlen(pstr) - 1; ind >= 0; ind--) {
if (pstr[ind] != ' ' && pstr[ind] != '\t') break;
pstr[ind] = '\0';
}
}
if (!pstr || !*pstr) {
if (plink->type == PV_LINK) dbCvtLinkToConstant(pdbentry);
if (plink->type != CONSTANT) return S_dbLib_badField;