umount: don't actually need char[2 * PATH_MAX] for realpath
*/
#include <getopt.h>
-
#include "libbb.h"
int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
{
char *buf;
char *fname;
+ char pathbuf[PATH_MAX];
USE_FEATURE_READLINK_FOLLOW(
unsigned opt;
logmode = LOGMODE_NONE;
if (opt) {
- buf = realpath(fname, bb_common_bufsiz1);
+ buf = realpath(fname, pathbuf);
} else {
buf = xmalloc_readlink_or_warn(fname);
}
int umount_main(int argc, char **argv)
{
int doForce;
- char path[2*PATH_MAX];
+ char path[PATH_MAX + 2];
struct mntent me;
FILE *fp;
char *fstype = 0;
// Do we already know what to umount this time through the loop?
if (m)
- safe_strncpy(path, m->dir, PATH_MAX);
+ safe_strncpy(path, m->dir, sizeof(path));
// For umount -a, end of mtab means time to exit.
else if (opt & OPT_ALL)
break;