mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Merge r27958 from nmap-npingchanges: Simplify print() in RawData::
This commit is contained in:
parent
30d25e7e1e
commit
8a023e0c06
1 changed files with 2 additions and 10 deletions
|
|
@ -162,16 +162,8 @@ int RawData::validate(){
|
|||
* header in the chain (if there is any).
|
||||
* @return OP_SUCCESS on success and OP_FAILURE in case of error. */
|
||||
int RawData::print(FILE *output, int detail) const {
|
||||
|
||||
if(detail<=PRINT_DETAIL_MED){
|
||||
fprintf(output, "Data[");
|
||||
fprintf(output, "%d byte%s]", this->length, (this->length!=1)? "s":"");
|
||||
}else{
|
||||
// Print hex dump
|
||||
fprintf(output, "Data[--HEXDUMP-- %d byte%s]", this->length, (this->length!=1)? "s":"");
|
||||
// @todo UNIMPLEMENTED. I don't want to use libnetutil's print_hexdump()
|
||||
// here because it introduces dependencies.
|
||||
}
|
||||
fprintf(output, "Payload[");
|
||||
fprintf(output, "%d byte%s]", this->length, (this->length!=1)? "s":"");
|
||||
if(this->next!=NULL){
|
||||
print_separator(output, detail);
|
||||
next->print(output, detail);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue