<<< Date Index >>>     <<< Thread Index >>>

Re: sscanf (pc,"%lu",&uidvalidity) (Re: [2005-03-22] CVS repository changes)



On Wed, Mar 23, 2005 at 01:13:19AM -0800, Brendan Cully wrote:
> On Tuesday, 22 March 2005 at 14:04, Tamotsu Takahashi wrote:
> > BTW, What about checking the return value of sscanf?
> > (as Yonetani-san said.)
> > 
> >     if (sscanf (pc, "%lu", &(idata->uid_validity)) != 1)
> >       goto fail;
> 
> probably a good idea in theory, but next thing you know we're
> checking the return value of malloc calls.

Aha, Okay. I don't object to you the IMAP code author. :)
It must be safe because you say so. Thanks for the information.
I just thought that a response from a server is less reliable
than a return value of a malloc (and we can do something after
sscanf failed, but we can do (almost) nothing after malloc
failed).

-- 
tamo