agent: Simplify stream_read_cstring.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 12 Apr 2017 00:24:48 +0000 (09:24 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 12 Apr 2017 00:24:48 +0000 (09:24 +0900)
* agent/command-ssh.c (stream_read_cstring): Just call
stream_read_string.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
agent/command-ssh.c

index b15d8b2..eeb1498 100644 (file)
@@ -674,13 +674,7 @@ stream_read_blob (estream_t stream, unsigned int secure, gcry_mpi_t *r_mpi)
 static gpg_error_t
 stream_read_cstring (estream_t stream, char **string)
 {
-  gpg_error_t err;
-  unsigned char *buffer;
-
-  err = stream_read_string (stream, 0, &buffer, NULL);
-  if (!err)
-    *string = (char *)buffer;
-  return err;
+  return stream_read_string (stream, 0, (unsigned char **)string, NULL);
 }