X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=client%2Fclient.c;h=a58a7b3461be31930ee2eb716f763891d42c2641;hb=0d42bb835c37442eeffa77f24ad2fdf876f8f4da;hp=b3bec5e0ed4121c1a9dcf1e19c8c630f4401d209;hpb=16ae6b899b1eb60c570650b7acc8e673531f5510;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index b3bec5e..a58a7b3 100644 --- a/client/client.c +++ b/client/client.c @@ -760,7 +760,7 @@ int cmd_authentication(const char *arg) } else if (r == 1) { - auth = nmem_malloc(nmem_auth, sizeof(*auth)); + auth = (Z_IdAuthentication *) nmem_malloc(nmem_auth, sizeof(*auth)); if (!strcmp(args[0], "-")) { auth->which = Z_IdAuthentication_anonymous; @@ -776,9 +776,10 @@ int cmd_authentication(const char *arg) } else if (r == 2) { - auth = nmem_malloc(nmem_auth, sizeof(*auth)); + auth = (Z_IdAuthentication *) nmem_malloc(nmem_auth, sizeof(*auth)); auth->which = Z_IdAuthentication_idPass; - auth->u.idPass = nmem_malloc(nmem_auth, sizeof(*auth->u.idPass)); + auth->u.idPass = (Z_IdPass *) + nmem_malloc(nmem_auth, sizeof(*auth->u.idPass)); auth->u.idPass->groupId = NULL; auth->u.idPass->userId = !strcmp(args[0], "-") ? 0 : args[0]; auth->u.idPass->password = !strcmp(args[1], "-") ? 0 : args[1]; @@ -787,9 +788,10 @@ int cmd_authentication(const char *arg) } else if (r == 3) { - auth = nmem_malloc(nmem_auth, sizeof(*auth)); + auth = (Z_IdAuthentication*) nmem_malloc(nmem_auth, sizeof(*auth)); auth->which = Z_IdAuthentication_idPass; - auth->u.idPass = nmem_malloc(nmem_auth, sizeof(*auth->u.idPass)); + auth->u.idPass = (Z_IdPass *) + nmem_malloc(nmem_auth, sizeof(*auth->u.idPass)); auth->u.idPass->groupId = args[1]; auth->u.idPass->userId = args[0]; auth->u.idPass->password = args[2]; @@ -3914,11 +3916,6 @@ static void handle_srw_record(Z_SRW_record *rec) printf("\n"); if (rec->recordData_buf && rec->recordData_len) { - if (fwrite(rec->recordData_buf, 1, rec->recordData_len, stdout) != - (size_t) (rec->recordData_len)) - { - printf("write to stdout failed\n"); - } printf("%.*s", rec->recordData_len, rec->recordData_buf); marc_file_write(rec->recordData_buf, rec->recordData_len); }