File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 27
27
#include <iniparser.h>
28
28
29
29
#include "configuraion.h"
30
+ #include "common.h"
30
31
31
32
static void clean_config (configuration_t * config ) {
32
33
int32_t i , j , k ;
@@ -45,12 +46,12 @@ configuration_t read_config(const char *filename) {
45
46
dictionary * ini = iniparser_load (filename );
46
47
char * touch_device_path = iniparser_getstring (ini , "general:touchdevice" , NULL );
47
48
if (touch_device_path ) {
48
- result .touch_device_path = malloc (strlen (touch_device_path ) + 1 );
49
- if (result .touch_device_path ) {
49
+ if (result .touch_device_path = malloc (strlen (touch_device_path ) + 1 )) {
50
50
strcpy (result .touch_device_path , touch_device_path );
51
51
}
52
52
} else {
53
- result .touch_device_path = NULL ;
53
+ errno = EINVAL ;
54
+ die ("error: no touch device defined" );
54
55
}
55
56
result .vert_scroll = iniparser_getboolean (ini , "scroll:vertical" , false);
56
57
result .horz_scroll = iniparser_getboolean (ini , "scroll:horizontal" , false);
You can’t perform that action at this time.
0 commit comments