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:
11
utils.h
11
utils.h
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user