1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-18 21:49:01 +00:00

Minor style fixes

This commit is contained in:
henri
2013-10-23 19:04:04 +00:00
parent 304240efc5
commit 9c083de2cf
3 changed files with 8 additions and 10 deletions

View File

@@ -66,7 +66,6 @@
/* Assumes space for fs has already been allocated */ /* Assumes space for fs has already been allocated */
int filespace_init(struct filespace *fs, int initial_size) { int filespace_init(struct filespace *fs, int initial_size) {
memset(fs, 0, sizeof(struct filespace)); memset(fs, 0, sizeof(struct filespace));
if (initial_size == 0) if (initial_size == 0)
initial_size = FS_INITSIZE_DEFAULT; initial_size = FS_INITSIZE_DEFAULT;
@@ -95,11 +94,6 @@ int fs_cat(struct filespace *fs, const char *str, int len) {
if (len == 0) if (len == 0)
return 0; return 0;
/*
printf("fscat: current_alloc=%d; current_size=%d; len=%d\n",
fs->current_alloc, fs->current_size, len);
*/
if (fs->current_alloc - fs->current_size < len + 2) { if (fs->current_alloc - fs->current_size < len + 2) {
char *tmpstr; char *tmpstr;

View File

@@ -92,7 +92,7 @@ static inline int fs_length(const struct filespace *fs) {
return fs->current_size; return fs->current_size;
} }
static inline char * fs_str(const struct filespace *fs) { static inline char *fs_str(const struct filespace *fs) {
return fs->str; return fs->str;
} }

View File

@@ -66,7 +66,8 @@
* NSE_STATUS_SUCCESS will be returned in the case of EOF or tiemout if at least * NSE_STATUS_SUCCESS will be returned in the case of EOF or tiemout if at least
* 1 char has been read. Also note that you may get more than 'nlines' back -- * 1 char has been read. Also note that you may get more than 'nlines' back --
* we just stop once "at least" 'nlines' is read */ * we just stop once "at least" 'nlines' is read */
nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler handler, int timeout_msecs, nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod,
nsock_ev_handler handler, int timeout_msecs,
void *userdata, int nlines) { void *userdata, int nlines) {
msiod *nsi = (msiod *)ms_iod; msiod *nsi = (msiod *)ms_iod;
mspool *ms = (mspool *)nsp; mspool *ms = (mspool *)nsp;
@@ -87,7 +88,8 @@ nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle
} }
/* Same as above, except it tries to read at least 'nbytes' instead of 'nlines'. */ /* Same as above, except it tries to read at least 'nbytes' instead of 'nlines'. */
nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler handler, int timeout_msecs, nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod,
nsock_ev_handler handler, int timeout_msecs,
void *userdata, int nbytes) { void *userdata, int nbytes) {
msiod *nsi = (msiod *)ms_iod; msiod *nsi = (msiod *)ms_iod;
@@ -111,7 +113,9 @@ nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle
/* The simplest read function -- returns NSE_STATUS_SUCCESS when it /* The simplest read function -- returns NSE_STATUS_SUCCESS when it
* reads anything, otherwise it returns timeout, eof, or error as appropriate */ * reads anything, otherwise it returns timeout, eof, or error as appropriate */
nsock_event_id nsock_read(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler handler, int timeout_msecs, void *userdata) { nsock_event_id nsock_read(nsock_pool nsp, nsock_iod ms_iod,
nsock_ev_handler handler, int timeout_msecs,
void *userdata) {
msiod *nsi = (msiod *)ms_iod; msiod *nsi = (msiod *)ms_iod;
mspool *ms = (mspool *)nsp; mspool *ms = (mspool *)nsp;
msevent *nse; msevent *nse;