harmonize coding style and messages
This commit is contained in:
@@ -71,7 +71,7 @@ lircin_init (Driver *drvthis)
|
|||||||
|
|
||||||
/* Alocate and store private data */
|
/* Alocate and store private data */
|
||||||
p = (PrivateData *) malloc(sizeof(PrivateData));
|
p = (PrivateData *) malloc(sizeof(PrivateData));
|
||||||
if( ! p ) {
|
if (p == NULL) {
|
||||||
report(RPT_ERR, "%s: Could not allocate private data.", drvthis->name);
|
report(RPT_ERR, "%s: Could not allocate private data.", drvthis->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -89,11 +89,12 @@ lircin_init (Driver *drvthis)
|
|||||||
/* READ CONFIG FILE:*/
|
/* READ CONFIG FILE:*/
|
||||||
|
|
||||||
/* Get location of lircrc to be used */
|
/* Get location of lircrc to be used */
|
||||||
if (drvthis->config_get_string ( drvthis->name , "lircrc" , 0 , NULL) != NULL)
|
if (drvthis->config_get_string(drvthis->name, "lircrc", 0 , NULL) != NULL) {
|
||||||
strncpy(s, drvthis->config_get_string(drvthis->name, "lircrc", 0, ""), sizeof(s));
|
strncpy(s, drvthis->config_get_string(drvthis->name, "lircrc", 0, ""), sizeof(s));
|
||||||
|
s[sizeof(s)-1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (*s != '\0') {
|
if (*s != '\0') {
|
||||||
s[sizeof(s)-1] = '\0';
|
|
||||||
p->lircrc = malloc(strlen(s) + 1);
|
p->lircrc = malloc(strlen(s) + 1);
|
||||||
if (p->lircrc == NULL) {
|
if (p->lircrc == NULL) {
|
||||||
report(RPT_ERR, "%s: Could not allocate new memory.", drvthis->name);
|
report(RPT_ERR, "%s: Could not allocate new memory.", drvthis->name);
|
||||||
@@ -144,6 +145,7 @@ lircin_init (Driver *drvthis)
|
|||||||
}
|
}
|
||||||
fcntl (p->lircin_fd, F_SETFD, FD_CLOEXEC);
|
fcntl (p->lircin_fd, F_SETFD, FD_CLOEXEC);
|
||||||
|
|
||||||
|
report(RPT_DEBUG, "%s: init() done", drvthis->name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user