<div dir="ltr">Hi,<div><br></div><div>   considering this: <pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,&quot;Liberation Mono&quot;,Menlo,Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(36,41,46);text-decoration-style:initial;text-decoration-color:initial;width:1px;height:1px"><a href="https://github.com/mkj/dropbear/blob/d740dc548924f2faf0934e5f9a4b83d2b5d6902d/atomicio.c#L55">https://github.com/mkj/dropbear/blob/d740dc548924f2faf0934e5f9a4b83d2b5d6902d/atomicio.c#L55</a></pre><div><br></div><div><br></div><div><br></div><div><div><span style="white-space:pre">                </span>switch (res) {</div><div><span style="white-space:pre">                </span>case -1:</div><div><span style="white-space:pre">                        </span>if (errno == EINTR || errno == EAGAIN)</div><div><span style="white-space:pre">                                </span>continue;</div><div><span style="white-space:pre">                        </span>return 0;</div><div><span style="white-space:pre">                </span>case 0:</div><div><span style="white-space:pre">                        </span>errno = EPIPE;</div><div><span style="white-space:pre">                        </span>return pos;</div><div><span style="white-space:pre">                </span>default:</div><div><span style="white-space:pre">                        </span>pos += (size_t)res;</div><div><span style="white-space:pre">                </span>}</div></div><div><br></div><div>What if res is negative less than -1, for example -2 ? Shouldn&#39;t be a check there that res is &gt; 0 ?</div><div><br></div><div>Thanks,</div><div><br></div><div>    Daniel.</div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Who’s got the sweetest disposition?<br>One guess, that’s who?<br>Who’d never, ever start an argument?<br>Who never shows a bit of temperament?<br>Who&#39;s never wrong but always right?<br>Who&#39;d never dream of starting a fight?<br>Who get stuck with all the bad luck? </div></div></div>