about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2006-08-26 16:50:24 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2006-08-26 16:50:24 +0000
commitd4c685c711208f33e10766734013415a372e93e4 (patch)
tree70b310c158194327e0d0a6ad34743ad0e4c2fe8c
parent061dfc6edd70967c15cf25e2472936b60b45d16d (diff)
downloadnetpbm-mirror-d4c685c711208f33e10766734013415a372e93e4.tar.gz
netpbm-mirror-d4c685c711208f33e10766734013415a372e93e4.tar.xz
netpbm-mirror-d4c685c711208f33e10766734013415a372e93e4.zip
pm_accept_to_pamtuples: fix bug: fill in pam structure
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@24 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--doc/HISTORY6
-rw-r--r--lib/libpam.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index fc875ec0..c6dcd25b 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -97,6 +97,12 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.36
 
+              pm_accept_to_pamtuples: fix bug: fill in pam structure.
+              Thanks "Christian Schlotter" <schlotter@users.sourceforge.net>.
+
+              Fix selection of MMX_SEE fastpath based on GNU compiler version
+              number.
+
               Eliminate pm_perror() in favor of informative error messages.
 
               libnetpbm: fix rgb:r/g/b color name parsing for invalid
diff --git a/lib/libpam.c b/lib/libpam.c
index bbfa7e32..6d2acba7 100644
--- a/lib/libpam.c
+++ b/lib/libpam.c
@@ -1074,7 +1074,7 @@ pm_feed_from_pamtuples(int    const pipeToFeedFd,
     outpam.file = fdopen(pipeToFeedFd, "w");
 
     /* The following signals (and normally kills) the process with
-       SIGPIPE if the pipe does not take all 'inputLength' bytes.
+       SIGPIPE if the pipe does not take all the data.
     */
     pnm_writepam(&outpam, *inputTuplesP->tuplesP);
 
@@ -1089,10 +1089,11 @@ pm_accept_to_pamtuples(int    const pipeToSuckFd,
 
     struct pamtuples * const outputTuplesP = accepterParm;
 
-    struct pam inpam;
+    struct pam * const inpamP = outputTuplesP->pamP;
 
     *outputTuplesP->tuplesP =
-        pnm_readpam(fdopen(pipeToSuckFd, "r"), &inpam, sizeof(inpam));
+        pnm_readpam(fdopen(pipeToSuckFd, "r"), inpamP,
+                    PAM_STRUCT_SIZE(tuple_type));
 
-    pm_close(inpam.file);
+    pm_close(inpamP->file);
 }