332 |
g_assert(v->type == ALPHA); |
g_assert(v->type == ALPHA); |
333 |
const gchar* text = g_value_get_string(src); |
const gchar* text = g_value_get_string(src); |
334 |
if ( text) |
if ( text) |
335 |
memcpy(val->s, text, v->width); |
{ |
336 |
|
memset(val->s, 0, v->width); |
337 |
|
memcpy(val->s, text, |
338 |
|
v->width < strlen(text)? v->width : strlen(text)); |
339 |
|
} |
340 |
else |
else |
341 |
goto lossage; |
goto lossage; |
342 |
} |
} |
513 |
g_assert(G_VALUE_HOLDS(&gval, G_TYPE_STRING)); |
g_assert(G_VALUE_HOLDS(&gval, G_TYPE_STRING)); |
514 |
|
|
515 |
const gchar *text = g_value_get_string(&gval); |
const gchar *text = g_value_get_string(&gval); |
516 |
memset(value->s, 0, v->width); |
memset(value->s, ' ', v->width); |
517 |
if ( text ) |
if ( text ) |
518 |
memcpy(value->s, text, strlen(text)); |
{ |
519 |
|
memcpy(value->s, text, |
520 |
|
strlen(text) < v->width ? strlen(text) : v->width); |
521 |
|
} |
522 |
} |
} |
523 |
else |
else |
524 |
{ |
{ |