Skip to content

Commit 105f673

Browse files
committed
Pick up fixed from libcups for cupsCreateCredentials, cupsCreateCredentialsRequest, and httpGetDateTime.
1 parent 187dd1e commit 105f673

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

cups/http-support.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ httpGetDateTime(const char *s) // I - Date/time string
756756
char mon[16]; // Abbreviated month name
757757
int day, year; // Day of month and year
758758
int hour, min, sec; // Time
759-
int days; // Number of days since 1970
759+
long days; // Number of days since 1970
760760
static const int normal_days[] = // Days to a month, normal years
761761
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
762762
static const int leap_days[] = // Days to a month, leap years
@@ -795,14 +795,14 @@ httpGetDateTime(const char *s) // I - Date/time string
795795
else
796796
days = normal_days[i] + day - 1;
797797

798-
DEBUG_printf("4httpGetDateTime: days=%d", days);
798+
DEBUG_printf("4httpGetDateTime: days=%ld", days);
799799

800800
days += (year - 1970) * 365 + // 365 days per year (normally)
801801
((year - 1) / 4 - 492) - // + leap days
802802
((year - 1) / 100 - 19) + // - 100 year days
803803
((year - 1) / 400 - 4); // + 400 year days
804804

805-
DEBUG_printf("4httpGetDateTime: days=%d\n", days);
805+
DEBUG_printf("4httpGetDateTime: days=%ld\n", days);
806806

807807
return (days * 86400 + hour * 3600 + min * 60 + sec);
808808
}

cups/tls-gnutls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ cupsCreateCredentials(
205205
if (!path)
206206
path = http_default_path(defpath, sizeof(defpath));
207207

208-
if (!path || !common_name)
208+
if (!path || !common_name || !*common_name)
209209
{
210210
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
211211
goto done;
@@ -561,7 +561,7 @@ cupsCreateCredentialsRequest(
561561
if (!path)
562562
path = http_default_path(defpath, sizeof(defpath));
563563

564-
if (!path || !common_name)
564+
if (!path || !common_name || !*common_name)
565565
{
566566
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
567567
goto done;

cups/tls-openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ cupsCreateCredentials(
290290
if (!path)
291291
path = http_default_path(defpath, sizeof(defpath));
292292

293-
if (!path || !common_name)
293+
if (!path || !common_name || !*common_name)
294294
{
295295
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
296296
return (false);
@@ -606,7 +606,7 @@ cupsCreateCredentialsRequest(
606606
if (!path)
607607
path = http_default_path(temp, sizeof(temp));
608608

609-
if (!path || !common_name)
609+
if (!path || !common_name || !*common_name)
610610
{
611611
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
612612
return (false);

0 commit comments

Comments
 (0)