asn1: Fix warnings
This commit is contained in:
@@ -357,7 +357,7 @@ dotype(unsigned char *buf, size_t len, char **argv, size_t *size)
|
|||||||
size_t matches = 0;
|
size_t matches = 0;
|
||||||
size_t sz;
|
size_t sz;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
char *s;
|
char *s = NULL;
|
||||||
void *v;
|
void *v;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
@@ -175,17 +175,21 @@ segv_handler(int sig)
|
|||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
char msg[] = "SIGSEGV i current test: ";
|
char msg[] = "SIGSEGV i current test: ";
|
||||||
|
/* For compilers that insist we check write(2)'s result here */
|
||||||
|
int e = 1;
|
||||||
|
|
||||||
fd = open("/dev/stdout", O_WRONLY, 0600);
|
fd = open("/dev/stdout", O_WRONLY, 0600);
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
write(fd, msg, sizeof(msg));
|
|
||||||
write(fd, current_test, strlen(current_test));
|
if (write(fd, msg, sizeof(msg)) == -1 ||
|
||||||
write(fd, " ", 1);
|
write(fd, current_test, strlen(current_test)) == -1 ||
|
||||||
write(fd, current_state, strlen(current_state));
|
write(fd, " ", 1) == -1 ||
|
||||||
write(fd, "\n", 1);
|
write(fd, current_state, strlen(current_state)) == -1 ||
|
||||||
close(fd);
|
write(fd, "\n", 1) == -1)
|
||||||
|
e = 2;
|
||||||
|
(void) close(fd);
|
||||||
}
|
}
|
||||||
_exit(1);
|
_exit(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@@ -597,6 +597,7 @@ _heim_time2generalizedtime (time_t t, heim_octet_string *s, int gtimep)
|
|||||||
{
|
{
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
const size_t len = gtimep ? 15 : 13;
|
const size_t len = gtimep ? 15 : 13;
|
||||||
|
int bytes;
|
||||||
|
|
||||||
s->data = NULL;
|
s->data = NULL;
|
||||||
s->length = 0;
|
s->length = 0;
|
||||||
@@ -607,14 +608,17 @@ _heim_time2generalizedtime (time_t t, heim_octet_string *s, int gtimep)
|
|||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
s->length = len;
|
s->length = len;
|
||||||
if (gtimep)
|
if (gtimep)
|
||||||
snprintf (s->data, len + 1, "%04d%02d%02d%02d%02d%02dZ",
|
bytes = snprintf(s->data, len + 1, "%04d%02d%02d%02d%02d%02dZ",
|
||||||
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
||||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||||
else
|
else
|
||||||
snprintf (s->data, len + 1, "%02d%02d%02d%02d%02d%02dZ",
|
bytes = snprintf(s->data, len + 1, "%02d%02d%02d%02d%02d%02dZ",
|
||||||
tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday,
|
tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday,
|
||||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||||
|
|
||||||
|
if (bytes > len)
|
||||||
|
abort();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user