Skip to content
Commit 0da2bb74 authored by Lennart Poettering's avatar Lennart Poettering Committed by Luca Boccassi
Browse files

hostname-util: normalize get_pretty_hostname() call semantics

get_pretty_hostname() so far had semantics not in line with our usual
ones: the return parameter was actually freed before the return string
written into it, because that's what parse_env_file() does. Moreover,
when the value was not set it would return NULL but succeed.

Let's normalize this, and only fill in the return value if there's
something set, and never read from it, like we usually do with return
parameter, and in particular those named "ret_xyz".

The existing callers don't really care about the differences, but it's
nicer to normalize behaviour to minimize surprises.
parent bed1f678
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment