diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-07-10 14:48:34 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-07-10 14:48:34 -0700 |
commit | e99a530f8cdca3ccd9e739cd092ed9865d12fe89 (patch) | |
tree | c2bef9f80ff9910be17757a83f61caed02146d0a /src/widget.c | |
parent | c59592b32f5b5808c12720bfd37ea73b473fa1db (diff) | |
download | emacs-e99a530f8cdca3ccd9e739cd092ed9865d12fe89.tar.gz |
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) { /* the tricky things with the sign is to make sure that -0 is printed -0. */ - int len; - char *tem; sprintf (shell_position, "=%c%d%c%d", flags & XNegative ? '-' : '+', x < 0 ? -x : x, flags & YNegative ? '-' : '+', y < 0 ? -y : y); - len = strlen (shell_position) + 1; - tem = xmalloc (len); - strncpy (tem, shell_position, len); - XtVaSetValues (wmshell, XtNgeometry, tem, NULL); + XtVaSetValues (wmshell, XtNgeometry, xstrdup (shell_position), NULL); } else if (flags & (WidthValue | HeightValue)) { - int len; - char *tem; sprintf (shell_position, "=%dx%d", pixel_width, pixel_height); - len = strlen (shell_position) + 1; - tem = xmalloc (len); - strncpy (tem, shell_position, len); - XtVaSetValues (wmshell, XtNgeometry, tem, NULL); + XtVaSetValues (wmshell, XtNgeometry, xstrdup (shell_position), NULL); } /* If the geometry spec we're using has W/H components, mark the size |