X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=blobdiff_plain;f=cups%2Fipp-support.c;fp=cups%2Fipp-support.c;h=926be7a5ee5dd4e77041884729f7bba37db076ca;hp=a94888160db52eb695d8fe931172f3b8eb55918c;hb=5d2cc5d32da88d72b6e9bbf5e89e05ca23f0a067;hpb=1a18c85cd15c6af88ec2c3a5ece0d67add6f56a7 diff --git a/cups/ipp-support.c b/cups/ipp-support.c index a94888160..926be7a5e 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp-support.c 11806 2014-04-09 16:12:27Z msweet $" + * "$Id: ipp-support.c 12095 2014-08-19 16:16:06Z msweet $" * * Internet Printing Protocol support functions for CUPS. * @@ -669,7 +669,14 @@ ippAttributeString( break; case IPP_TAG_RESOLUTION : - if (buffer && bufptr < bufend) + if (val->resolution.xres == val->resolution.yres) + { + if (buffer && bufptr < bufend) + bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d%s", val->resolution.xres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm"); + else + bufptr += snprintf(temp, sizeof(temp), "%d%s", val->resolution.xres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm"); + } + else if (buffer && bufptr < bufend) bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm"); else bufptr += snprintf(temp, sizeof(temp), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm"); @@ -2122,7 +2129,7 @@ ippSetPort(int p) /* I - Port number to use */ /* * 'ippStateString()' - Return the name corresponding to a state value. * - * @since CUPS 2.0@ + * @since CUPS 2.0/OS 10.10@ */ const char * /* O - State name */ @@ -2256,5 +2263,5 @@ ipp_col_string(ipp_t *col, /* I - Collection attribute */ /* - * End of "$Id: ipp-support.c 11806 2014-04-09 16:12:27Z msweet $". + * End of "$Id: ipp-support.c 12095 2014-08-19 16:16:06Z msweet $". */