summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-01-22 06:57:41 -0800
committerToomas Soome <tsoome@me.com>2020-01-25 09:25:59 +0200
commit12661a24a0babe84d0a1b8d1fe46fb61dcc5011e (patch)
tree23a421b0e4379067932850703bf662aa848e196f /usr/src
parentd851c23803d14c57f342f6cca648ec3bfb5ea9d1 (diff)
downloadillumos-joyent-12661a24a0babe84d0a1b8d1fe46fb61dcc5011e.tar.gz
12238 stabs: smatch errors
Reviewed by: Matthias Scheler <mscheler@tintri.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/tools/stabs/stabs.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/usr/src/tools/stabs/stabs.c b/usr/src/tools/stabs/stabs.c
index 3bf7bab52d..54029bf4d7 100644
--- a/usr/src/tools/stabs/stabs.c
+++ b/usr/src/tools/stabs/stabs.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
@@ -82,10 +80,9 @@ debug(int level, char *cp, char *fmt, ...)
tmp[i] = cp[i];
}
tmp[i] = '\0';
- (void) sprintf(buf, "%s [cp='%s']\n", fmt, tmp);
+ (void) snprintf(buf, sizeof (buf), "%s [cp='%s']\n", fmt, tmp);
} else {
- strcpy(buf, fmt);
- strcat(buf, "\n");
+ (void) snprintf(buf, sizeof (buf), "%s\n", fmt);
}
va_start(ap, fmt);
@@ -102,7 +99,7 @@ expected(
char *where) /* where we were in the line of input */
{
fprintf(stderr, "%s, input line %d: expecting \"%s\" at \"%s\"\n",
- who, line_number, what, where);
+ who, line_number, what, where);
exit(1);
}
@@ -117,7 +114,7 @@ get_line(void)
if (line_number == debug_line) {
fprintf(stderr, "Hit debug line number %d\n", line_number);
for (;;)
- sleep(1);
+ (void) sleep(1);
}
return (cp);
}
@@ -239,7 +236,7 @@ parseline(char *cp)
if (tagdef) {
tagdecl(cp, &tdp, h, w);
} else {
- tdefdecl(cp, h, &tdp);
+ (void) tdefdecl(cp, h, &tdp);
tagadd(w, h, tdp);
}
}
@@ -384,10 +381,10 @@ tagdecl(char *cp, struct tdesc **rtdp, int h, char *w)
switch (*cp++) {
case 's':
- soudef(cp, STRUCT, rtdp);
+ (void) soudef(cp, STRUCT, rtdp);
break;
case 'u':
- soudef(cp, UNION, rtdp);
+ (void) soudef(cp, UNION, rtdp);
break;
case 'e':
enumdef(cp, rtdp);