From: rodin Date: Fri, 16 Oct 2009 09:51:04 +0000 (+0000) Subject: Don't use getline(), it is not supported under BSD/OSX X-Git-Tag: v0.9~319 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=6540e629e91accc5202dc7574d8e747c3fed2c58;p=projects%2Fchimara%2Fchimara.git Don't use getline(), it is not supported under BSD/OSX --- diff --git a/libchimara/chimara-if.c b/libchimara/chimara-if.c index e3553b1..16175d7 100644 --- a/libchimara/chimara-if.c +++ b/libchimara/chimara-if.c @@ -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; } - 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='")) { - dlname = g_strndup(line + 8, length - 10); + dlname = g_strndup(line + 8, strlen(line) - 10); break; } }