X-Git-Url: http://git.indexdata.com/?p=yazpp-moved-to-github.git;a=blobdiff_plain;f=src%2Fyaz-my-client.cpp;h=7c4e479b361f0013857b5a0fd6d5e7ba0926318a;hp=5fc292d35ffefc42146ecf78eab4091d7e531d2f;hb=8353663886b90d762d43790780be6cb58fb93c8a;hpb=fa96bc0dcc16f6ac3e33b5144664e51cb7d09874 diff --git a/src/yaz-my-client.cpp b/src/yaz-my-client.cpp index 5fc292d..7c4e479 100644 --- a/src/yaz-my-client.cpp +++ b/src/yaz-my-client.cpp @@ -1,8 +1,6 @@ -/* - * Copyright (c) 1998-2007, Index Data. +/* This file is part of the yazpp toolkit. + * Copyright (C) 1998-2011 Index Data and Mike Taylor * See the file LICENSE for details. - * - * $Id: yaz-my-client.cpp,v 1.28 2007-04-16 21:54:23 adam Exp $ */ #include @@ -116,7 +114,7 @@ char *MyClient::get_cookie(Z_OtherInformation **otherInfo) Z_OtherInformationUnit *oi = update_otherInformation(otherInfo, 0, yaz_oid_userinfo_cookie, 1, 1); - if (oi->which == Z_OtherInfo_characterInfo) + if (oi && oi->which == Z_OtherInfo_characterInfo) return oi->information.characterInfo; return 0; } @@ -155,7 +153,7 @@ void MyClient::recv_diagrecs(Z_DiagRec **pp, int num) } else r = p->u.defaultFormat; - printf(" [%d] %s", *r->condition, diagbib1_str(*r->condition)); + printf(" [" ODR_INT_PRINTF "] %s", *r->condition, diagbib1_str(*r->condition)); switch (r->which) { case Z_DefaultDiagFormat_v2Addinfo: @@ -279,7 +277,7 @@ void MyClient::recv_searchResponse(Z_SearchResponse *searchResponse) else { printf ("Ok\n"); - printf ("Hits: %d\n", *searchResponse->resultCount); + printf ("Hits: " ODR_INT_PRINTF "\n", *searchResponse->resultCount); } recv_records (searchResponse->records); } @@ -554,6 +552,7 @@ int main(int argc, char **argv) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab