Don't use getline(), it is not supported under BSD/OSX
authorMarijn van Vliet <marijn.vanvliet@med.kuleuven.be>
Fri, 16 Oct 2009 09:51:04 +0000 (09:51 +0000)
committerMarijn van Vliet <marijn.vanvliet@med.kuleuven.be>
Fri, 16 Oct 2009 09:51:04 +0000 (09:51 +0000)
git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@146 ddfedd41-794f-dd11-ae45-00112f111e67

libchimara/chimara-if.c

index e3553b1c3248b353013a3f9854345d2042dff79b..16175d7f603f9d45a2c92592a0f0b4268ee53cac 100644 (file)
@@ -179,14 +179,12 @@ find_dlname(const gchar *pluginfile, GError **error)
                g_set_error(error, G_FILE_ERROR, errno, "Error opening '%s': %s", pluginfile, g_strerror(errno));
                return NULL;
        }
                g_set_error(error, G_FILE_ERROR, errno, "Error opening '%s': %s", pluginfile, g_strerror(errno));
                return NULL;
        }
-       gchar *line = NULL;
-       size_t buflen;
-       ssize_t length;
-       while((length = getline(&line, &buflen, plugin)) != -1)
+       gchar line[256];
+       while( fgets(line, 256, plugin) != NULL)
        {       
                if(g_str_has_prefix(line, "dlname='"))
                {
        {       
                if(g_str_has_prefix(line, "dlname='"))
                {
-                       dlname = g_strndup(line + 8, length - 10);
+                       dlname = g_strndup(line + 8, strlen(line) - 10);
                        break;
                }
        }
                        break;
                }
        }