* Copyright (C) 2007-2017 Tobias Brunner
* Copyright (C) 2005-2007 Martin Willi
* Copyright (C) 2005 Jan Hutter
- * Hochschule fuer Technik Rapperswil
+ * HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
memcpy(this->to, this->from, bytes);
memset(this->from + bytes, 0x00, len - bytes);
memset(this->to + bytes, 0xff, len - bytes);
- this->from[bytes-1] &= ~mask;
- this->to[bytes-1] |= mask;
+
+ if (bytes)
+ {
+ this->from[bytes-1] &= ~mask;
+ this->to[bytes-1] |= mask;
+ }
}
/**
written += print_in_hook(data, "%d", this->protocol);
}
}
-
- if (has_proto && has_ports)
+ else
{
- written += print_in_hook(data, "/");
+ written += print_in_hook(data, "0");
}
/* build port string */
if (has_ports)
{
+ written += print_in_hook(data, "/");
+
if (this->from_port == this->to_port)
{
struct servent *serv;