X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=038907057f640a160ffc10439bc2ec8530dfb7f3;hb=a87770ed51d988ce5a0b2f5f886dd4211c4055d6;hp=09ab220f70e213dca4ca4b1f7e87be9d0895da46;hpb=74b2585ecf03192ddc7cf9796634b9cde008ec8b;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 09ab220..0389070 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.245 2004-07-30 08:37:52 adam Exp $ + * $Id: client.c,v 1.248 2004-09-03 18:55:59 adam Exp $ */ #include @@ -379,9 +379,25 @@ static int process_initResponse(Z_InitResponse *res) printf("Guessing visiblestring:\n"); printf("'%s'\n", uif->u. octet_aligned->buf); } else if (uif->which == Z_External_single) { - /* Peek at any private Init-diagnostic APDUs */ Odr_any *sat = uif->u.single_ASN1_type; - printf("### NAUGHTY: External is '%s'\n", sat->buf); + oident *oid = oid_getentbyoid(uif->direct_reference); + if (oid->value == VAL_OCLCUI) { + Z_OCLC_UserInformation *oclc_ui; + ODR decode = odr_createmem(ODR_DECODE); + odr_setbuf(decode, sat->buf, sat->len, 0); + if (!z_OCLC_UserInformation(decode, &oclc_ui, 0, 0)) + printf ("Bad OCLC UserInformation:\n"); + else + printf ("OCLC UserInformation:\n"); + if (!z_OCLC_UserInformation(print, &oclc_ui, 0, 0)) + printf ("Bad OCLC UserInformation spec\n"); + odr_destroy(decode); + } + else + { + /* Peek at any private Init-diagnostic APDUs */ + printf("### NAUGHTY: External is '%.*s'\n", sat->len, sat->buf); + } } odr_reset (print); } @@ -3212,7 +3228,7 @@ int cmd_register_oid(const char* args) { name = oid_str; val = 0; - while (isdigit (*name)) + while (isdigit (*(unsigned char *) name)) { val = val*10 + (*name - '0'); name++; @@ -3976,7 +3992,7 @@ void process_cmd_line(char* line) char* lastnonspace=NULL; for(;*p; ++p) { - if(!isspace(*p)) { + if(!isspace(*(unsigned char *) p)) { lastnonspace = p; } }