Page MenuHomeClusterLabs Projects

Error-check snprintf() calls
Open, WishlistPublic

Description

According to the printf(3) man page, which also documents snprintf(): "If an output error is encountered, a negative value is returned." There is no mention of errno, so we'd need to use some generic code like EIO.

I don't know if a negative return value is actually possible for snprintf() in practice.

If we decide to check for negative return values, we should probably create a wrapper function and possibly assert. Checking after each snprintf() call is too tedious.

Event Timeline

nrwahl2 triaged this task as Wishlist priority.Fri, Feb 28, 8:45 PM
nrwahl2 created this task.
nrwahl2 created this object with edit policy "Restricted Project (Project)".