HomeFreeBSD

runat.c: Add an explicit check for snprintf() failure

Description

runat.c: Add an explicit check for snprintf() failure

The check for "outsiz" too large was probably sufficient to
catch failures, since it was cast to an unsigned (size_t).
However, it seems appropriate to add an explicit check for
a failed case (returning -1).

Discussed with: oshogbo
Fixes: 0660de8172cd ("runat: Add a runat(1) utility similar to the Solaris one")

Details

Provenance
rmacklemAuthored on May 10 2025, 2:44 PM
Parents
rG48578dcb6b7e: cp: Fix issues with destination directory mode.
Branches
Unknown
Tags
Unknown