replace sprintf all over the place

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1635 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-05-02 14:29:33 +00:00
parent 1495f52771
commit dd02a92a8b
55 changed files with 831 additions and 471 deletions

View File

@@ -38,7 +38,7 @@ SOURCES = \
herror.c hstrerror.c inaddr2str.c inet_aton.c \
initgroups.c k_getpwnam.c k_getpwuid.c lstat.c \
memmove.c mini_inetd.c putenv.c rcmd.c setegid.c setenv.c \
seteuid.c signal.c strcasecmp.c strchr.c strdup.c \
seteuid.c signal.c snprintf.c strcasecmp.c strchr.c strdup.c \
strerror.c strftime.c strlwr.c strnlen.c strrchr.c \
strupr.c tm2time.c unsetenv.c verify.c verr.c \
verrx.c vsyslog.c vwarn.c vwarnx.c warn.c warnx.c \

View File

@@ -49,7 +49,7 @@
extern const char *__progname;
#ifndef __GNUC__
#if !defined(__GNUC__) && !defined(__attribute__)
#define __attribute__(x)
#endif

View File

@@ -49,7 +49,7 @@
extern const char *__progname;
#ifndef __GNUC__
#if !defined(__GNUC__) && !defined(__attribute__)
#define __attribute__(x)
#endif

View File

@@ -94,6 +94,6 @@ mini_inetd (int port)
close(s);
dup2(s2, STDIN_FILENO);
dup2(s2, STDOUT_FILENO);
/* dup2(s2, STDERR_FILENO); */
dup2(s2, STDERR_FILENO);
close(s2);
}

View File

@@ -97,6 +97,7 @@ dns_free_data(struct dns_reply *r)
rr = rr->next;
free(tmp);
}
free (r);
}
static struct dns_reply*

View File

@@ -60,12 +60,10 @@ setenv(const char *var, const char *val, int rewrite)
if (!rewrite && getenv(var) != 0)
return 0;
if ((t = malloc(strlen(var) + strlen(val) + 2)) == 0)
asprintf (&t, "%s=%s", var, val);
if (t == NULL)
return -1;
strcpy(t, var);
strcat(t, "=");
strcat(t, val);
if (putenv(t) == 0)
return 0;
else

View File

@@ -54,7 +54,7 @@ strerror(int eno)
static char emsg[1024];
if(eno < 0 || eno >= sys_nerr)
sprintf(emsg, "Error %d occurred.", eno);
snprintf(emsg, sizeof(emsg), "Error %d occurred.", eno);
else
strcpy(emsg, sys_errlist[eno]);