summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-13 02:08:51 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-08-13 02:08:51 +0000
commit92c26f7e1c4cb6b02ef2fcdbe982c3c20379ef3b (patch)
tree03958115296221d1185f364031422ecfe0f078bd
parentMake /usr/bin/python a symlink to python-wrapper. (diff)
downloadeselect-python-92c26f7e1c4cb6b02ef2fcdbe982c3c20379ef3b.tar.gz
eselect-python-92c26f7e1c4cb6b02ef2fcdbe982c3c20379ef3b.tar.bz2
eselect-python-92c26f7e1c4cb6b02ef2fcdbe982c3c20379ef3b.zip
Fix compilation warnings (bug #280373).
-rw-r--r--python.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/python.c b/python.c
index 1748547..58d009f 100644
--- a/python.c
+++ b/python.c
@@ -34,7 +34,7 @@ const char* find_path(const char* exe)
return strndup(exe, last_slash - exe);
}
char* path = strdup(getenv("PATH"));
- char* state;
+ char* state = NULL;
const char* token = strtok_r(path, ":", &state);
while (token)
{
@@ -135,8 +135,6 @@ int sort_python(const struct dirent**f1, const struct dirent** f2)
const char* find_latest(const char* exe)
{
- int major = -1;
- int minor = -1;
const char* path = find_path(exe);
if (! path || ! *path)
{
@@ -160,7 +158,7 @@ const char* find_latest(const char* exe)
return ret;
}
-int main(int argc, char** argv)
+int main(__attribute__((unused)) int argc, char** argv)
{
if (strlen(program_description) == 0)
abort();
@@ -175,7 +173,7 @@ int main(int argc, char** argv)
fstat(fileno(f), &st);
size_t size = st.st_size;
char* cont = malloc(size + 1);
- fgets(cont, size + 1, f);
+ cont = fgets(cont, size + 1, f);
fclose(f);
size_t len = strlen(cont);
if (len && cont[len - 1] == '\n')