Skip to content

Commit

Permalink
fix typo in get_new_comment_id
Browse files Browse the repository at this point in the history
swapped id and type parameter. Also start ids at 1 like before.
  • Loading branch information
sni committed Jun 22, 2023
1 parent c10ad7a commit 696a5a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/naemon/comments.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static GHashTable *comment_hashtable;
int initialize_comment_data(void)
{
comment_hashtable = g_hash_table_new(g_direct_hash, g_direct_equal);
next_comment_id = 0;
next_comment_id = 1;
return OK;
}

Expand Down Expand Up @@ -64,7 +64,7 @@ static unsigned long get_next_comment_id(void)
{
unsigned long new_id = next_comment_id;
for (;;) {
if (!find_comment(HOST_COMMENT | SERVICE_COMMENT, new_id)) {
if (!find_comment(new_id, HOST_COMMENT | SERVICE_COMMENT)) {
return new_id;
}
new_id++;
Expand Down

0 comments on commit 696a5a9

Please sign in to comment.