<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -111,8 +111,18 @@ Pvoid_t read_parameters()
 {
         Pvoid_t params = NULL;
         unsigned int len, bytes = 0;
-        if (!fscanf(stdin, &quot;%u\n&quot;, &amp;len))
+        unsigned char tmp;
+ 
+        if (!fscanf(stdin, &quot;%u&quot;, &amp;len))
                 die(&quot;Couldn't parse parameter set size&quot;);
+        /* Read a newline after the size spec. Earlier I did 
+         * fscanf(stdin, &quot;%u\n&quot;, &amp;len)
+         * on the line above, but this was a stupid idea. Fscanf interpretes
+         * *any* whitespace character as a sign to read *any number* of
+         * following whitespace characters, which obviously caused great havoc
+         * here.
+         * */
+        fread(&amp;tmp, 1, 1, stdin);
         while (bytes &lt; len){
                 p_entry *key = read_netstr_entry(&amp;bytes);      
                 p_entry *val = read_netstr_entry(&amp;bytes);</diff>
      <filename>ext/disco.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7f6963f8301855f12c920d31128f66fb16bf0267</id>
    </parent>
  </parents>
  <author>
    <name>Ville Tuulos</name>
    <email>tuulos@nxfront.nokiapaloalto.com</email>
  </author>
  <url>http://github.com/tuulos/disco/commit/c00bbeeb752829efd6450f310adc9b25e6e8bc37</url>
  <id>c00bbeeb752829efd6450f310adc9b25e6e8bc37</id>
  <committed-date>2008-07-12T16:08:30-07:00</committed-date>
  <authored-date>2008-07-12T16:08:30-07:00</authored-date>
  <message>fixed a fatal bug in disco.c -- in some cases read_parameters() would
read too many bytes, which broke everything</message>
  <tree>15023d44d8342ec2386e3356a8983955d7f72d12</tree>
  <committer>
    <name>Ville Tuulos</name>
    <email>tuulos@nxfront.nokiapaloalto.com</email>
  </committer>
</commit>
