summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-09-21 15:07:11 +0000
committerjbj <devnull@localhost>2001-09-21 15:07:11 +0000
commit1eef0782f60f9d8d80be273ace982ad4c2a56d98 (patch)
treeca6f47772d1cfa3b9900cf93ae515f1c5a31a4cd /build
parent59a045374df64f3bc62eb200f7d11338ea2787a8 (diff)
downloadlibrpm-tizen-1eef0782f60f9d8d80be273ace982ad4c2a56d98.tar.gz
librpm-tizen-1eef0782f60f9d8d80be273ace982ad4c2a56d98.tar.bz2
librpm-tizen-1eef0782f60f9d8d80be273ace982ad4c2a56d98.zip
- lclint-3.0.0.15 fiddles.
CVS patchset: 5067 CVS date: 2001/09/21 15:07:11
Diffstat (limited to 'build')
-rw-r--r--build/expression.c3
-rw-r--r--build/files.c3
-rw-r--r--build/names.c19
-rw-r--r--build/parsePreamble.c2
-rw-r--r--build/parseScript.c1
5 files changed, 22 insertions, 6 deletions
diff --git a/build/expression.c b/build/expression.c
index 14b059bad..71bc588ab 100644
--- a/build/expression.c
+++ b/build/expression.c
@@ -261,6 +261,7 @@ static int rdToken(ParseState state)
if (xisdigit(*p)) {
char temp[EXPRBUFSIZ], *t = temp;
+ temp[0] = '\0';
while (*p && xisdigit(*p))
*t++ = *p++;
*t++ = '\0';
@@ -272,6 +273,7 @@ static int rdToken(ParseState state)
} else if (xisalpha(*p)) {
char temp[EXPRBUFSIZ], *t = temp;
+ temp[0] = '\0';
while (*p && (xisalnum(*p) || *p == '_'))
*t++ = *p++;
*t++ = '\0';
@@ -283,6 +285,7 @@ static int rdToken(ParseState state)
} else if (*p == '\"') {
char temp[EXPRBUFSIZ], *t = temp;
+ temp[0] = '\0';
p++;
while (*p && *p != '\"')
*t++ = *p++;
diff --git a/build/files.c b/build/files.c
index 2eaad7714..54dd86b25 100644
--- a/build/files.c
+++ b/build/files.c
@@ -444,10 +444,12 @@ static int parseForDev(char * buf, FileList fl)
{} ;
if (*pe == '\0') {
fl->devmajor = atoi(p);
+ /*@-unsignedcompare @*/ /* LCL: ge is ok */
if (!(fl->devmajor >= 0 && fl->devmajor < 256)) {
errstr = "devmajor";
goto exit;
}
+ /*@=unsignedcompare @*/
pe++;
} else {
errstr = "devmajor";
@@ -1027,6 +1029,7 @@ static void checkHardLinks(FileList fl)
FileListRec ilp, jlp;
int i, j;
+ nlangs[0] = '\0';
for (i = 0; i < fl->fileListRecsUsed; i++) {
char *te;
diff --git a/build/names.c b/build/names.c
index 4438b403f..321146e1b 100644
--- a/build/names.c
+++ b/build/names.c
@@ -9,15 +9,16 @@
#include "rpmbuild.h"
#include "debug.h"
+typedef /*@owned@*/ /*@null@*/ const char * ugstr_t;
+
static uid_t uids[1024];
-/*@owned@*/ /*@null@*/ static const char *unames[1024];
+static ugstr_t unames[1024];
static int uid_used = 0;
static gid_t gids[1024];
-/*@owned@*/ /*@null@*/ static const char *gnames[1024];
+static ugstr_t gnames[1024];
static int gid_used = 0;
-/*@-nullderef@*/ /* FIX: shrug */
void freeNames(void)
{
int x;
@@ -33,6 +34,7 @@ const char *getUname(uid_t uid)
int x;
for (x = 0; x < uid_used; x++) {
+ if (unames[x] == NULL) continue;
if (uids[x] == uid)
return unames[x];
}
@@ -54,6 +56,7 @@ const char *getUnameS(const char *uname)
int x;
for (x = 0; x < uid_used; x++) {
+ if (unames[x] == NULL) continue;
if (!strcmp(unames[x],uname))
return unames[x];
}
@@ -75,6 +78,7 @@ uid_t getUidS(const char *uname)
int x;
for (x = 0; x < uid_used; x++) {
+ if (unames[x] == NULL) continue;
if (!strcmp(unames[x],uname))
return uids[x];
}
@@ -96,6 +100,7 @@ const char *getGname(gid_t gid)
int x;
for (x = 0; x < gid_used; x++) {
+ if (gnames[x] == NULL) continue;
if (gids[x] == gid)
return gnames[x];
}
@@ -117,6 +122,7 @@ const char *getGnameS(const char *gname)
int x;
for (x = 0; x < gid_used; x++) {
+ if (gnames[x] == NULL) continue;
if (!strcmp(gnames[x], gname))
return gnames[x];
}
@@ -138,6 +144,7 @@ gid_t getGidS(const char *gname)
int x;
for (x = 0; x < gid_used; x++) {
+ if (gnames[x] == NULL) continue;
if (!strcmp(gnames[x], gname))
return gids[x];
}
@@ -152,7 +159,6 @@ gid_t getGidS(const char *gname)
gnames[x] = (gr ? xstrdup(gr->gr_name) : xstrdup(gname));
return gids[x];
}
-/*@=nullderef@*/
int_32 *const getBuildTime(void)
{
@@ -171,7 +177,10 @@ const char *const buildHost(void)
if (! gotit) {
(void) gethostname(hostname, sizeof(hostname));
- if ((hbn = /*@-unrecog@*/ gethostbyname(hostname) /*@=unrecog@*/ ))
+ /*@-unrecog -multithreaded @*/
+ hbn = gethostbyname(hostname);
+ /*@=unrecog =multithreaded @*/
+ if (hbn)
strcpy(hostname, hbn->h_name);
else
rpmMessage(RPMMESS_WARNING,
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 104be59dd..bc0bb0184 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -753,7 +753,7 @@ static inline void initPreambleList(void)
/**
*/
static int findPreambleTag(Spec spec, /*@out@*/int * tag,
- /*@null@*/ /*@out@*/ const char ** macro, char * lang)
+ /*@null@*/ /*@out@*/ const char ** macro, /*@out@*/ char * lang)
/*@modifies *tag, *macro, *lang @*/
{
PreambleRec p;
diff --git a/build/parseScript.c b/build/parseScript.c
index 1d8a1dfd7..ee24c93cb 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -92,6 +92,7 @@ int parseScript(Spec spec, int parsePart)
const char **argv = NULL;
poptContext optCon = NULL;
+ reqargs[0] = '\0';
name = NULL;
prog = "/bin/sh";
file = NULL;