diff options
| author | Lennart Poettering <lennart@poettering.net> | 2009-04-13 22:21:08 +0200 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2009-04-13 22:21:08 +0200 | 
| commit | 1d8da03886f95c93b4e9bee45c17da377c783231 (patch) | |
| tree | d37c7d218b32b9502a2c54401df09808895d6ccb /src | |
| parent | 1b4e5f197a9bef30fc13c592cbfd65d2c9a9476a (diff) | |
core-util: filter utf8 in pa_machine_id()
Diffstat (limited to 'src')
| -rw-r--r-- | src/pulsecore/core-util.c | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index f4776f2e..24d929d7 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -2462,7 +2462,7 @@ char *pa_machine_id(void) {          pa_strip_nl(ln);          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 @@ -2480,13 +2480,16 @@ char *pa_machine_id(void) {                  break;          } else if (strlen(c) < l-1) { +            char *u;              if (*c == 0) {                  pa_xfree(c);                  break;              } -            return c; +            u = pa_utf8_filter(c); +            pa_xfree(c); +            return u;          }          /* 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 -     * the IPv4 address.  Mit not be that stable. */ +     * the IPv4 address.  Might not be that stable. */      return pa_sprintf_malloc("%08lx", (unsigned long) gethostid);  }  | 
