Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
Fixed bad terminator in literals.c fields
Browse files Browse the repository at this point in the history
  • Loading branch information
istoffa committed Aug 1, 2017
1 parent f35a3ef commit 2b2eda3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/literals.c
@@ -1,11 +1,11 @@
//
// Created by istoffa on 7/28/17.
//

#include <stdlib.h>
#include "literals.h"

/* IANA protocol list subset*/
const struct nff_literal_s nff_proto_id_map[]={
struct nff_literal_s nff_proto_id_map[]={
{ "ICMP", 1 },
{ "IGMP", 2 },
{ "IPv4", 4 },
Expand All @@ -25,11 +25,11 @@ const struct nff_literal_s nff_proto_id_map[]={
{ "SCTP", 132 },
{ "UDPLite", 136 },
// terminator
{ "", 0U }
{ NULL, 0U }
};

/* IANA assigned port names subset */
const struct nff_literal_s nff_port_map[]={
struct nff_literal_s nff_port_map[]={
{ "tcpmux", 1 },
{ "echo", 7 },
{ "discard", 9 },
Expand All @@ -51,15 +51,15 @@ const struct nff_literal_s nff_port_map[]={
{ "http", 80 },
{ "https", 443 },
// terminator
{ "", 0U }
{ NULL, 0U }
};

const struct nff_literal_s * nff_get_protocol_map()
struct nff_literal_s * nff_get_protocol_map()
{
return &nff_proto_id_map[0];
}

const struct nff_literal_s * nff_get_port_map()
struct nff_literal_s * nff_get_port_map()
{
return &nff_port_map[0];
}
Expand Down
4 changes: 2 additions & 2 deletions src/literals.h
Expand Up @@ -13,7 +13,7 @@ typedef struct nff_literal_s {
}nff_literal_t;


const struct nff_literal_s * nff_get_protocol_map();
const struct nff_literal_s * nff_get_port_map();
struct nff_literal_s * nff_get_protocol_map();
struct nff_literal_s * nff_get_port_map();

#endif //IPFIXCOL_RVALUES_H
2 changes: 1 addition & 1 deletion src/lnf_filter.c
Expand Up @@ -185,7 +185,7 @@ ff_error_t lnf_rval_map_func(ff_t *filter, const char *valstr, ff_type_t type, f
// Universal processing for literals
nff_literal_t *item = NULL;

for (int x = 0; dict[x].name != ""; x++) {
for (int x = 0; dict[x].name != NULL; x++) {
if (!strcasecmp(valstr, dict[x].name)) {
item = &dict[x];
break;
Expand Down

0 comments on commit 2b2eda3

Please sign in to comment.