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) <[email protected]>
---
 wmkeys/wmkeys.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/wmkeys/wmkeys.c b/wmkeys/wmkeys.c
index 718ccd5..72d98e7 100644
--- a/wmkeys/wmkeys.c
+++ b/wmkeys/wmkeys.c
@@ -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);
-- 
2.5.0


-- 
To unsubscribe, send mail to [email protected].

Reply via email to