+Wed Sep 13 10:45:25 1995 Keith Vetter (keithv@fusion.com)
+
+ * keysalt.c: 16/32 bit integer mismatch.
+ * str_conv.c: sftime_format_table is conditional upon HAVE_STRFTIME,
+ cast some constants to long so that math wouldn't overflow,
+ 16/32 bit integer size mismatch.
+
Wed Sep 13 18:17:30 1995 Theodore Y. Ts'o <tytso@dcl>
* alt_prof.c (krb5_read_realm_params): Fix memory leak. Free the
const char *tseplist;
const char *ksseplist;
const char *septmp;
+ size_t len;
kret = 0;
kp = string;
/* Squirrel away old keysalt array */
savep = *ksaltp;
+ len = (size_t) *nksaltp;
/* Get new keysalt array */
if (*ksaltp = (krb5_key_salt_tuple *)
- malloc(((*nksaltp)+1) * sizeof(krb5_key_salt_tuple))) {
+ malloc((len + 1) * sizeof(krb5_key_salt_tuple))) {
/* Copy old keysalt if appropriate */
if (savep) {
memcpy(*ksaltp, savep,
- (*nksaltp) * sizeof(krb5_key_salt_tuple));
+ len * sizeof(krb5_key_salt_tuple));
krb5_xfree(savep);
}
static const char sftime_last_fmt[] = "%d/%m/%y %R";
#endif /* HAVE_STRFTIME */
static const char sftime_default_fmt[] = "%02d/%02d/%02d %02d:%02d";
-static const int sftime_default_len = 2+1+2+1+2+1+2+1+2+1;
+static const size_t sftime_default_len = 2+1+2+1+2+1+2+1+2+1;
/* Delta time strings */
static const char dtscan_dhms_notext[] = "%d-%02d:%02d:%02d";
/*
* Lookup tables.
*/
+
static const struct enctype_lookup_entry enctype_table[] = {
/* krb5_enctype input specifier output string */
/*------------- ----------------------- ------------------------*/
static const int atime_format_table_nents = sizeof(atime_format_table)/
sizeof(atime_format_table[0]);
+#ifdef HAVE_STRFTIME
static const char * const sftime_format_table[] = {
sftime_ldep_time, /* Default locale-dependent date and time */
sftime_med_fmt, /* dd mon yy hh:mm:ss */
};
static const int sftime_format_table_nents = sizeof(sftime_format_table)/
sizeof(sftime_format_table[0]);
+#endif /* HAVE_STRFTIME */
static const struct deltat_match_entry deltat_table[] = {
/* scan format nmatch daypos hourpos minpos secpos */
for (i=0; i<flags_table_nents; i++) {
if (!strcasecmp(&string[cpos], flags_table[i].fl_specifier)) {
found = 1;
- if (sense == flags_table[i].fl_sense)
+ if (sense == (int) flags_table[i].fl_sense)
*flagsp |= flags_table[i].fl_flags;
else
*flagsp &= ~flags_table[i].fl_flags;
char * pad;
{
struct tm *tmp;
- int i;
+ size_t i;
size_t ndone;
tmp = localtime((time_t *) ×tamp);
krb5_deltat dt;
krb5_error_code retval;
- days = deltat / (24*3600);
- dt = deltat % (24*3600);
- hours = dt / 3600;
+ days = (int) (deltat / (24*3600l));
+ dt = deltat % (24*3600l);
+ hours = (int) (dt / 3600);
dt %= 3600;
- minutes = dt / 60;
- seconds = dt % 60;
+ minutes = (int) (dt / 60);
+ seconds = (int) (dt % 60);
retval = 0;
if (days) {