213
213
prop[3].vals = vals.user;
214
214
prop[4].vals = vals.process;
216
for (i = 0; i < G_N_ELEMENTS (prop); i++) {
216
for (i = 0; i < G_N_ELEMENTS (prop); i++)
217
217
props[i] = &prop[i];
220
219
pw = getpwuid (getuid ());
222
221
/* While setting all the properties, safe casts are being used. */
222
const gchar *casting_warning = "Casting problem occured in the session manager. Xpad might not function as expected. Please send a bugreport.";
223
223
vals.user->value = pw ? pw->pw_name : "";
224
224
string_length = strlen (vals.user->value);
225
225
if (string_length <= INT_MAX)
226
226
vals.user->length = (int) string_length;
228
g_warning("While setting the session manager properties a casting problem has occured. Xpad might not function as expected. Please send a bugreport.");
228
g_warning(casting_warning);
230
230
vals.program->value = command;
231
231
string_length = strlen (vals.program->value);
232
232
if (string_length <= INT_MAX)
233
233
vals.program->length = (int) string_length;
235
g_warning("While setting the session manager properties a casting problem has occured. Xpad might not function as expected. Please send a bugreport.");
235
g_warning(casting_warning);
237
237
vals.clone->value = command;
238
238
string_length = strlen (vals.clone->value);
239
239
if (string_length <= INT_MAX)
240
240
vals.clone->length = (int) string_length;
242
g_warning("While setting the session manager properties a casting problem has occured. Xpad might not function as expected. Please send a bugreport.");
242
g_warning(casting_warning);
244
244
vals.restart[0].value = command;
245
245
string_length = strlen (vals.restart[0].value);
246
246
if (string_length <= INT_MAX)
247
247
vals.restart[0].length = (int) string_length;
249
g_warning("While setting the session manager properties a casting problem has occured. Xpad might not function as expected. Please send a bugreport.");
249
g_warning(casting_warning);
251
251
vals.restart[1].value = "--sm-client-id";
252
252
string_length = strlen (vals.restart[1].value);
253
253
if (string_length <= INT_MAX)
254
254
vals.restart[1].length = (int) string_length;
256
g_warning("While setting the session manager properties a casting problem has occured. Xpad might not function as expected. Please send a bugreport.");
256
g_warning(casting_warning);
258
258
vals.restart[2].value = client_id;
259
259
string_length = strlen (vals.restart[2].value);
260
260
if (string_length <= INT_MAX)
261
261
vals.restart[2].length = (int) string_length;
263
g_warning("While setting the session manager properties a casting problem has occured. Xpad might not function as expected. Please send a bugreport.");
263
g_warning(casting_warning);
265
265
pid_str = g_strdup_printf ("%i", getpid ());
266
266
vals.process->value = pid_str;