1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Reduce use of utils.h for error functions

This commit is contained in:
dmiller
2017-04-20 22:39:08 +00:00
parent 0ff217dc53
commit e813de759a
18 changed files with 33 additions and 23 deletions

11
utils.h
View File

@@ -137,8 +137,7 @@
#endif
#include "nbase.h"
#include "nmap_error.h"
#include <assert.h>
/* Arithmatic difference modulo 2^32 */
#ifndef MOD_DIFF
@@ -161,9 +160,7 @@
/* Return num if it is between min and max. Otherwise return min or max
(whichever is closest to num). */
template<class T> T box(T bmin, T bmax, T bnum) {
if (bmin > bmax)
fatal("box(%d, %d, %d) called (min,max,num)", (int) bmin, (int) bmax, (int) bnum);
// assert(bmin <= bmax);
assert(bmin <= bmax);
if (bnum >= bmax)
return bmax;
if (bnum <= bmin)
@@ -190,10 +187,6 @@ void bintohexstr(char *buf, int buflen, char *src, int srclen);
u8 *parse_hex_string(char *str, size_t *outlen);
#ifndef HAVE_STRERROR
char *strerror(int errnum);
#endif
int cpe_get_part(const char *cpe);
char *mmapfile(char *fname, int *length, int openflags);