X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fsrwtst.c;h=5c3d4bd9f6f83b84d59bbeb0e0418b81c48364b6;hb=2ffab517f033bf6c35de72616de5c05e0b43319f;hp=7de077c08847ce4afaf92babb9c5256b1b117f44;hpb=ee6ab2ee3a9ee1a8c65d7272ec7fba1d886f5af0;p=yaz-moved-to-github.git diff --git a/util/srwtst.c b/util/srwtst.c index 7de077c..5c3d4bd 100644 --- a/util/srwtst.c +++ b/util/srwtst.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2009 Index Data * See the file LICENSE for details. */ @@ -74,8 +74,11 @@ int main(int argc, char **argv) { fprintf (stderr, "%d\n", i); if (res->records[i].recordData_buf) - fwrite(res->records[i].recordData_buf, 1, - res->records[i].recordData_len, stderr); + { + fprintf(stderr, "%.*s", + res->records[i].recordData_len, + res->records[i].recordData_buf); + } } } } @@ -85,7 +88,9 @@ int main(int argc, char **argv) ret = z_soap_codec(encode, &soap_package, &content_buf, &content_len, h); if (content_buf && content_len) - fwrite (content_buf, content_len, 1, stdout); + { + printf("%.*s", content_len, content_buf); + } else { fprintf(stderr, "No output!\n"); @@ -105,6 +110,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