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:
parent
1d92de9867
commit
4fad0812e8
|
@ -94,7 +94,7 @@ void enable_configuration(int n);
|
||||||
* Main
|
* Main
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
num_configs = 0;
|
num_configs = 0;
|
||||||
current_config = 0;
|
current_config = 0;
|
||||||
|
@ -105,6 +105,8 @@ void main(int argc, char *argv[])
|
||||||
|
|
||||||
read_config();
|
read_config();
|
||||||
wmkeys_routine(argc, argv);
|
wmkeys_routine(argc, argv);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -179,7 +181,7 @@ void draw_string(char* s)
|
||||||
* getline()
|
* getline()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int getline(FILE* pfile, char* s, int lim)
|
int getline_wmkeys(FILE* pfile, char* s, int lim)
|
||||||
{
|
{
|
||||||
int c = 0, i;
|
int c = 0, i;
|
||||||
for(i=0; i<lim-1 && (c=fgetc(pfile)) != EOF && c!='\n'; ++i) {
|
for(i=0; i<lim-1 && (c=fgetc(pfile)) != EOF && c!='\n'; ++i) {
|
||||||
|
@ -226,10 +228,10 @@ void read_config()
|
||||||
}
|
}
|
||||||
|
|
||||||
while(!feof(pfile)) {
|
while(!feof(pfile)) {
|
||||||
getline(pfile, key, 256);
|
getline_wmkeys(pfile, key, 256);
|
||||||
|
|
||||||
if(!feof(pfile)) {
|
if(!feof(pfile)) {
|
||||||
getline(pfile, value, 256);
|
getline_wmkeys(pfile, value, 256);
|
||||||
|
|
||||||
configs[num_configs].name = malloc(sizeof(char)*strlen(key)+1);
|
configs[num_configs].name = malloc(sizeof(char)*strlen(key)+1);
|
||||||
strcpy(configs[num_configs].name, key);
|
strcpy(configs[num_configs].name, key);
|
||||||
|
|
Loading…
Reference in a new issue