Skip to content

Commit

Permalink
DVR: fix for the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
perexg committed Mar 26, 2018
1 parent 0039baf commit c2a6b61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/dvr/dvr_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -2822,11 +2822,12 @@ dvr_entry_class_autorec_caption_get(void *o)
dvr_entry_t *de = (dvr_entry_t *)o;
dvr_autorec_entry_t *dae = de->de_autorec;
if (dae) {
const int comment = !strempty(dae->dae_comment);
snprintf(prop_sbuf, PROP_SBUF_LEN, "%s%s%s%s",
dae->dae_name ?: "",
(dae->dae_comment != '\0' && strcmp(dae->dae_comment,"") != 0) ? " (" : "",
(dae->dae_comment != '\0' && strcmp(dae->dae_comment,"") != 0) ? dae->dae_comment : "",
(dae->dae_comment != '\0' && strcmp(dae->dae_comment,"") != 0) ? ")" : "");
comment ? " (" : "",
comment ? dae->dae_comment : "",
comment ? ")" : "");
} else
prop_sbuf[0] = '\0';
return &prop_sbuf_ptr;
Expand Down
8 changes: 0 additions & 8 deletions src/lang_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,6 @@ int lang_str_compare( const lang_str_t *ls1, const lang_str_t *ls2 )
return 0;
}

int strempty(const char* c) {
return !c || c[0] == 0;
}

int lang_str_empty(lang_str_t* str) {
return strempty(lang_str_get(str, NULL));
}

size_t lang_str_size(const lang_str_t *ls)
{
lang_str_ele_t *e;
Expand Down
8 changes: 5 additions & 3 deletions src/lang_str.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ lang_str_t *lang_str_deserialize
/* Compare */
int lang_str_compare ( const lang_str_t *ls1, const lang_str_t *ls2 );

/* Empty */
int strempty(const char* c);
int lang_str_empty(lang_str_t* str);
/* Is string empty? */
static inline int strempty(const char *c)
{ return c == NULL || *c == '\0'; }
static inline int lang_str_empty(lang_str_t* str)
{ return strempty(lang_str_get(str, NULL)); }

/* Size in bytes */
size_t lang_str_size ( const lang_str_t *ls );
Expand Down

0 comments on commit c2a6b61

Please sign in to comment.