mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
core-util: filter utf8 in pa_machine_id()
This commit is contained in:
parent
1b4e5f197a
commit
1d8da03886
1 changed files with 6 additions and 3 deletions
|
|
@ -2462,7 +2462,7 @@ char *pa_machine_id(void) {
|
||||||
pa_strip_nl(ln);
|
pa_strip_nl(ln);
|
||||||
|
|
||||||
if (r && ln[0])
|
if (r && ln[0])
|
||||||
return pa_xstrdup(ln);
|
return pa_utf8_filter(ln);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The we fall back to the host name. It supposed to be somewhat
|
/* The we fall back to the host name. It supposed to be somewhat
|
||||||
|
|
@ -2480,13 +2480,16 @@ char *pa_machine_id(void) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} else if (strlen(c) < l-1) {
|
} else if (strlen(c) < l-1) {
|
||||||
|
char *u;
|
||||||
|
|
||||||
if (*c == 0) {
|
if (*c == 0) {
|
||||||
pa_xfree(c);
|
pa_xfree(c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
u = pa_utf8_filter(c);
|
||||||
|
pa_xfree(c);
|
||||||
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hmm, the hostname is as long the space we offered the
|
/* Hmm, the hostname is as long the space we offered the
|
||||||
|
|
@ -2498,7 +2501,7 @@ char *pa_machine_id(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If no hostname was set we use the POSIX hostid. It's usually
|
/* If no hostname was set we use the POSIX hostid. It's usually
|
||||||
* the IPv4 address. Mit not be that stable. */
|
* the IPv4 address. Might not be that stable. */
|
||||||
return pa_sprintf_malloc("%08lx", (unsigned long) gethostid);
|
return pa_sprintf_malloc("%08lx", (unsigned long) gethostid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue