Article View: comp.sources.bugs
Article #2334PC-MAIL release 2, Patch 1 (RE-POST)
From: Wietse Z. Venema
Date: Sun, 11 Feb 1990 13:16
Date: Sun, 11 Feb 1990 13:16
63 lines
2287 bytes
2287 bytes
This is a re-post of a patch posted earlier. Apparently, it never
made it out of our country; every now and then there seems to be
a major lossage of news at our national or continental backbone.
This patch takes care of a bug in some MicroSoft C implementations of
the sscanf() library function that causes the pc-mail programs to
believe there is more unread mail than there actually is. This problem
definitely does not occur on the UNIX systems that I tried the software
on (SunOS 4.0.3 and MicroPort System-V/AT 2.3).
In order to apply the patch, cd to the `main' subdirectory and feed
this article to the patch command. If you do not have the patch program,
the changes are quite straightforward and can easily be applied by hand.
*** newseqno.c- Mon Jan 22 13:04:30 1990
--- newseqno.c Mon Jan 29 15:50:48 1990
***************
*** 30,38 ****
/* CREATION DATE
/* Sat Mar 28 18:10:53 GMT+1:00 1987
/* LAST MODIFICATION
! /* 90/01/22 13:02:19
/* VERSION/RELEASE
! /* 2.1
/*--*/
#include "defs.h"
--- 30,38 ----
/* CREATION DATE
/* Sat Mar 28 18:10:53 GMT+1:00 1987
/* LAST MODIFICATION
! /* 90/01/29 15:50:46
/* VERSION/RELEASE
! /* 2.2
/*--*/
#include "defs.h"
***************
*** 72,81 ****
public unsigned seqno(s)
char *s;
{
! int seq;
! char junk;
! if (strlen(s) == NAMELEN && sscanf(s + 1, "%u%c", &seq, &junk) == 1)
return (seq);
else
return (0);
--- 72,84 ----
public unsigned seqno(s)
char *s;
{
! unsigned seq;
! char junk = 0;
! /* MicroSoft C sscanf() does not terminate if assignment to seq fails */
!
! if (strlen(s) == NAMELEN && sscanf(s + 1, "%u%c", &seq, &junk) == 1
! && junk == 0)
return (seq);
else
return (0);
Technical Details
Message-ID:
<623@wzv.win.tue.nl>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!apple!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!eutrc3!wzv!wietseShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!apple!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!eutrc3!wzv!wietse From: wietse@wzv.win.tue.nl (Wietse Z. Venema) Newsgroups: comp.sources.bugs Subject: PC-MAIL release 2, Patch 1 (RE-POST) Keywords: sscanf, MSC Message-ID: <623@wzv.win.tue.nl> Date: 11 Feb 90 13:16:59 GMT Organization: Eindhoven University of Technology, The Netherlands Lines: 63