X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=util%2Fsrwtst.c;h=bace12ae570eb8581db4de7f69261c0657b86d8f;hp=31a362e89b0f0db14a6a3518431b70742373aa48;hb=99f1879827d5be93a6363b5adbc83b824135dd88;hpb=fe507b6b15788a3a8e58063d9dae52532a5229a5 diff --git a/util/srwtst.c b/util/srwtst.c index 31a362e..bace12a 100644 --- a/util/srwtst.c +++ b/util/srwtst.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. - * - * $Id: srwtst.c,v 1.8 2007-05-06 20:12:20 adam Exp $ */ #include @@ -76,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); + } } } } @@ -87,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"); @@ -107,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