vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Mon, May 16, 2005 at 12:26:14AM +0200, Han Boetes wrote: > Hi, > > A few more improvements for mg: > - Proper incantations for snprintf(). > + size_t ret; > + ret = snprintf(file, sizeof(file), "%s/.mg", home); > + if ((int)ret == -1 || ret >= sizeof(file)) is this the preferred way in OpenBSD, casting to int? I have pondered this before when trying to make a single function that checks snprintf, strlcat and strlcpy, based on the return value and the limit used in those functions. -- <jakemsr@jakemsr.com> |