Project

General

Profile

Bug #4688

Inverted logic in api_epg.c

Added by Dave Pickles about 7 years ago. Updated about 7 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Start date:
2017-10-25
Due date:
% Done:

100%

Estimated time:
Found in version:
4.3-584~g5f843530a-dirty
Affected Versions:

Description

Function htsmsg_get_u32() returns zero on success and an error number on failure. However there are two occurrences in api_epg.c where an error exit is taken when zero is returned.

--- api_epg.c.old 2017-10-25 12:49:13.871382555 0100
++ api_epg.c 2017-10-25 12:51:02.138515653 +0100
@ -528,7 +528,7 @
epg_broadcast_t *e;
char *lang;

- if (!htsmsg_get_u32(args, "eventId", &id))
+ if (htsmsg_get_u32(args, "eventId", &id))
return -EINVAL;

/* Main Job */
@ -558,7 +558,7 @
epg_episode_t *ep, *ep2;
char *lang;

- if (!htsmsg_get_u32(args, "eventId", &id))
+ if (htsmsg_get_u32(args, "eventId", &id))
return -EINVAL;

/* Main Job */

I have checked all other uses of this function and these are the only cases.

Apologies for not submitting a PR; my limited git knowledge won't handle two PRs outstanding at the same time.

History

#1

Updated by Jaroslav Kysela about 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|7d0e509ba0b73d2187bc27329e72c869f8c2f2b8.

Also available in: Atom PDF