r10577: Fix error in ReadFile()
authorJelmer Vernooij <jelmer@samba.org>
Wed, 28 Sep 2005 13:55:19 +0000 (13:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:06 +0000 (13:39 -0500)
(This used to be commit 04b8c473d7d55d4d802631074843e43fe7d9cfea)

testprogs/win32/npecho/npecho_client.c

index 4131bd37924b2c90e4125b27abe5e50e8c56ee15..97d31c4318444362c8d40ec93fa3ff928a0033c4 100755 (executable)
@@ -13,7 +13,7 @@ int main(int argc, char *argv[])
 {
        HANDLE h;
        DWORD numread = 0;
-       char outbuffer[512];
+       char *outbuffer = malloc(strlen(ECHODATA));
 
        if (argc == 1) {
                printf("Usage: %s pipename\n", argv[0]);
@@ -27,12 +27,12 @@ int main(int argc, char *argv[])
                return -1;
        }
 
-       if (!WriteFile(h, ECHODATA, strlen(ECHODATA), NULL, NULL)) {
+       if (!WriteFile(h, ECHODATA, strlen(ECHODATA), &numread, NULL)) {
                printf("Error writing: %d\n", GetLastError());
                return -1;
        }
 
-       if (!ReadFile(h, outbuffer, strlen(ECHODATA), NULL, NULL)) {
+       if (!ReadFile(h, outbuffer, strlen(ECHODATA), &numread, NULL)) {
                printf("Error reading: %d\n", GetLastError());
                return -1;
        }