wmkeys compilation bugs

This patch solves a bug and a warning:

- The dockapp wmkeys uses the getline function, that is the same
  function provided by stdio.h. This patch changes the function
  name to getline_wmkeys.
- The main function returns void, and should return integer. This
  patch includes the return 0 at the function end and it changes
  the function prototype.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
This commit is contained in:
Rodolfo García Peñas (kix) 2015-08-16 00:22:49 +02:00 committed by Carlos R. Mafra
parent 1d92de9867
commit 4fad0812e8

View file

@ -94,7 +94,7 @@ void enable_configuration(int n);
* Main
*/
void main(int argc, char *argv[])
int main(int argc, char *argv[])
{
num_configs = 0;
current_config = 0;
@ -105,6 +105,8 @@ void main(int argc, char *argv[])
read_config();
wmkeys_routine(argc, argv);
return 0;
}
/*
@ -179,7 +181,7 @@ void draw_string(char* s)
* getline()
*/
int getline(FILE* pfile, char* s, int lim)
int getline_wmkeys(FILE* pfile, char* s, int lim)
{
int c = 0, i;
for(i=0; i<lim-1 && (c=fgetc(pfile)) != EOF && c!='\n'; ++i) {
@ -226,10 +228,10 @@ void read_config()
}
while(!feof(pfile)) {
getline(pfile, key, 256);
getline_wmkeys(pfile, key, 256);
if(!feof(pfile)) {
getline(pfile, value, 256);
getline_wmkeys(pfile, value, 256);
configs[num_configs].name = malloc(sizeof(char)*strlen(key)+1);
strcpy(configs[num_configs].name, key);