MANPAGES += sys-utils/readprofile.8
dist_noinst_DATA += sys-utils/readprofile.8.adoc
readprofile_SOURCES = sys-utils/readprofile.c
+readprofile_LDADD = $(LDADD) libcommon.la
endif
if BUILD_TUNELP
#include <sys/utsname.h>
#include <unistd.h>
+#include "c.h"
+#include "strutils.h"
#include "nls.h"
#include "xalloc.h"
#include "closestream.h"
int main(int argc, char **argv)
{
FILE *map;
- int proFd;
- char *mapFile, *proFile, *mult = NULL;
+ int proFd, has_mult = 0, multiplier = 0;
+ char *mapFile, *proFile;
size_t len = 0, indx = 1;
unsigned long long add0 = 0;
unsigned int step;
optInfo++;
break;
case 'M':
- mult = optarg;
+ multiplier = strtol_or_err(optarg, _("failed to parse multiplier"));
+ has_mult = 1;
break;
case 'r':
optReset++;
}
}
- if (optReset || mult) {
- int multiplier, fd, to_write;
+ if (optReset || has_mult) {
+ int fd, to_write;
/* When writing the multiplier, if the length of the
* write is not sizeof(int), the multiplier is not
* changed. */
- if (mult) {
- multiplier = strtoul(mult, NULL, 10);
+ if (has_mult) {
to_write = sizeof(int);
} else {
multiplier = 0;