-/* $OpenBSD: mkinit.c,v 1.3 1996/06/23 14:21:23 deraadt Exp $ */
+/* $OpenBSD: mkinit.c,v 1.4 1996/09/15 22:58:09 millert Exp $ */
/* $NetBSD: mkinit.c,v 1.14 1996/02/18 12:29:21 mycroft Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: mkinit.c,v 1.3 1996/06/23 14:21:23 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mkinit.c,v 1.4 1996/09/15 22:58:09 millert Exp $";
#endif
#endif /* not lint */
int indent;
char *p;
- sprintf(line, "\n /* from %s: */\n", fname);
+ snprintf(line, sizeof(line), "\n /* from %s: */\n", fname);
addstr(line, &ep->code);
addstr(" {\n", &ep->code);
for (;;) {
-/* $OpenBSD: mknodes.c,v 1.2 1996/06/23 14:21:24 deraadt Exp $ */
+/* $OpenBSD: mknodes.c,v 1.3 1996/09/15 22:58:09 millert Exp $ */
/* $NetBSD: mknodes.c,v 1.11 1995/05/11 21:29:36 christos Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)mknodes.c 8.2 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: mknodes.c,v 1.2 1996/06/23 14:21:24 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mknodes.c,v 1.3 1996/09/15 22:58:09 millert Exp $";
#endif
#endif /* not lint */
fp->name = savestr(name);
if (strcmp(type, "nodeptr") == 0) {
fp->type = T_NODE;
- sprintf(decl, "union node *%s", name);
+ snprintf(decl, sizeof(decl), "union node *%s", name);
} else if (strcmp(type, "nodelist") == 0) {
fp->type = T_NODELIST;
- sprintf(decl, "struct nodelist *%s", name);
+ snprintf(decl, sizeof(decl), "struct nodelist *%s", name);
} else if (strcmp(type, "string") == 0) {
fp->type = T_STRING;
- sprintf(decl, "char *%s", name);
+ snprintf(decl, sizeof(decl), "char *%s", name);
} else if (strcmp(type, "int") == 0) {
fp->type = T_INT;
- sprintf(decl, "int %s", name);
+ snprintf(decl, sizeof(decl), "int %s", name);
} else if (strcmp(type, "other") == 0) {
fp->type = T_OTHER;
} else if (strcmp(type, "temp") == 0) {
-/* $OpenBSD: mksyntax.c,v 1.2 1996/06/23 14:21:24 deraadt Exp $ */
+/* $OpenBSD: mksyntax.c,v 1.3 1996/09/15 22:58:08 millert Exp $ */
/* $NetBSD: mksyntax.c,v 1.11 1995/05/11 21:29:37 christos Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: mksyntax.c,v 1.2 1996/06/23 14:21:24 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mksyntax.c,v 1.3 1996/09/15 22:58:08 millert Exp $";
#endif
#endif /* not lint */
/* Generate the #define statements in the header file */
fputs("/* Syntax classes */\n", hfile);
for (i = 0 ; synclass[i].name ; i++) {
- sprintf(buf, "#define %s %d", synclass[i].name, i);
+ snprintf(buf, sizeof(buf), "#define %s %d", synclass[i].name, i);
fputs(buf, hfile);
for (pos = strlen(buf) ; pos < 32 ; pos = (pos + 8) & ~07)
putc('\t', hfile);
putc('\n', hfile);
fputs("/* Syntax classes for is_ functions */\n", hfile);
for (i = 0 ; is_entry[i].name ; i++) {
- sprintf(buf, "#define %s %#o", is_entry[i].name, 1 << i);
+ snprintf(buf, sizeof(buf), "#define %s %#o",
+ is_entry[i].name, 1 << i);
fputs(buf, hfile);
for (pos = strlen(buf) ; pos < 32 ; pos = (pos + 8) & ~07)
putc('\t', hfile);