diff options
| author | Paul Eggert | 2012-07-10 14:48:34 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-07-10 14:48:34 -0700 |
| commit | e99a530f8cdca3ccd9e739cd092ed9865d12fe89 (patch) | |
| tree | c2bef9f80ff9910be17757a83f61caed02146d0a /src/widget.c | |
| parent | c59592b32f5b5808c12720bfd37ea73b473fa1db (diff) | |
| download | emacs-e99a530f8cdca3ccd9e739cd092ed9865d12fe89.tar.gz emacs-e99a530f8cdca3ccd9e739cd092ed9865d12fe89.zip | |
Simplify by avoiding confusing use of strncpy etc.
Diffstat (limited to 'src/widget.c')
| -rw-r--r-- | src/widget.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/widget.c b/src/widget.c index e219c200e00..b94c30f4e9c 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -429,25 +429,15 @@ set_frame_size (EmacsFrame ew) | |||
| 429 | { | 429 | { |
| 430 | /* the tricky things with the sign is to make sure that | 430 | /* the tricky things with the sign is to make sure that |
| 431 | -0 is printed -0. */ | 431 | -0 is printed -0. */ |
| 432 | int len; | ||
| 433 | char *tem; | ||
| 434 | sprintf (shell_position, "=%c%d%c%d", | 432 | sprintf (shell_position, "=%c%d%c%d", |
| 435 | flags & XNegative ? '-' : '+', x < 0 ? -x : x, | 433 | flags & XNegative ? '-' : '+', x < 0 ? -x : x, |
| 436 | flags & YNegative ? '-' : '+', y < 0 ? -y : y); | 434 | flags & YNegative ? '-' : '+', y < 0 ? -y : y); |
| 437 | len = strlen (shell_position) + 1; | 435 | XtVaSetValues (wmshell, XtNgeometry, xstrdup (shell_position), NULL); |
| 438 | tem = xmalloc (len); | ||
| 439 | strncpy (tem, shell_position, len); | ||
| 440 | XtVaSetValues (wmshell, XtNgeometry, tem, NULL); | ||
| 441 | } | 436 | } |
| 442 | else if (flags & (WidthValue | HeightValue)) | 437 | else if (flags & (WidthValue | HeightValue)) |
| 443 | { | 438 | { |
| 444 | int len; | ||
| 445 | char *tem; | ||
| 446 | sprintf (shell_position, "=%dx%d", pixel_width, pixel_height); | 439 | sprintf (shell_position, "=%dx%d", pixel_width, pixel_height); |
| 447 | len = strlen (shell_position) + 1; | 440 | XtVaSetValues (wmshell, XtNgeometry, xstrdup (shell_position), NULL); |
| 448 | tem = xmalloc (len); | ||
| 449 | strncpy (tem, shell_position, len); | ||
| 450 | XtVaSetValues (wmshell, XtNgeometry, tem, NULL); | ||
| 451 | } | 441 | } |
| 452 | 442 | ||
| 453 | /* If the geometry spec we're using has W/H components, mark the size | 443 | /* If the geometry spec we're using has W/H components, mark the size |