user-accounts: Fix when GDM isn't installed

When GDM isn't installed, or isn't installed in the correct prefix,
avoid accessing std_out[-1] of a 0-length std_out.
This commit is contained in:
Bastien Nocera 2011-01-21 14:27:08 +00:00
parent 2650556c59
commit 3be95176ef

View file

@ -223,7 +223,7 @@ update_boolean_from_gconf (GtkWidget *widget,
return;
}
if (std_out[strlen (std_out) - 1] == '\n') {
if (strlen (std_out) > 0 && std_out[strlen (std_out) - 1] == '\n') {
std_out[strlen (std_out) - 1] = 0;
}