mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
lakka_get_project() function - cleanup
This commit is contained in:
parent
d745891b14
commit
a912d7176f
@ -87,12 +87,15 @@ static char lakka_project[128];
|
|||||||
|
|
||||||
static char *lakka_get_project(void)
|
static char *lakka_get_project(void)
|
||||||
{
|
{
|
||||||
FILE *command_file = NULL;
|
size_t len;
|
||||||
command_file = popen("cat /etc/release | cut -d - -f 1", "r");
|
FILE *command_file = popen("cat /etc/release | cut -d - -f 1", "r");
|
||||||
|
|
||||||
fgets(lakka_project, sizeof(lakka_project), command_file);
|
fgets(lakka_project, sizeof(lakka_project), command_file);
|
||||||
size_t len = strlen(lakka_project);
|
len = strlen(lakka_project);
|
||||||
|
|
||||||
if (len > 0 && lakka_project[len-1] == '\n')
|
if (len > 0 && lakka_project[len-1] == '\n')
|
||||||
lakka_project[--len] = '\0';
|
lakka_project[--len] = '\0';
|
||||||
|
|
||||||
pclose(command_file);
|
pclose(command_file);
|
||||||
return lakka_project;
|
return lakka_project;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user