diff options
author | Keerthi Kondaka <Keerthi.Kondaka@Sun.COM> | 2009-04-21 16:35:55 -0700 |
---|---|---|
committer | Keerthi Kondaka <Keerthi.Kondaka@Sun.COM> | 2009-04-21 16:35:55 -0700 |
commit | e059026e2da8f12ef0ebea9d686d67f32660cfc0 (patch) | |
tree | 695c417c9f8a1526c7ea7dc3a93dde1f25b41ab7 /usr/src/lib/print/libpapi-dynamic/common/nss.c | |
parent | 37c30c18a30adf1c89f3e563208e93e6c7501ded (diff) | |
download | illumos-gate-e059026e2da8f12ef0ebea9d686d67f32660cfc0.tar.gz |
6783023 lpstat -v dumps core without printer name
Diffstat (limited to 'usr/src/lib/print/libpapi-dynamic/common/nss.c')
-rw-r--r-- | usr/src/lib/print/libpapi-dynamic/common/nss.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr/src/lib/print/libpapi-dynamic/common/nss.c b/usr/src/lib/print/libpapi-dynamic/common/nss.c index ab26d41d89..02d74b17e7 100644 --- a/usr/src/lib/print/libpapi-dynamic/common/nss.c +++ b/usr/src/lib/print/libpapi-dynamic/common/nss.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */ @@ -116,10 +116,14 @@ solaris_lpsched_shortcircuit_hack(papi_attribute_t ***list) return; } - if ((printer = strrchr(uri->path, '/')) == NULL) - printer = uri->path; - else - printer++; + if (uri->path == NULL) { + printer = ""; + } else { + if ((printer = strrchr(uri->path, '/')) == NULL) + printer = uri->path; + else + printer++; + } /* is there an lpsched queue (printer/class) */ snprintf(buf, sizeof (buf), "/etc/lp/interfaces/%s", printer); |