]> code.delx.au - gnu-emacs/blobdiff - src/xrdb.c
Rework C source files to avoid ^(
[gnu-emacs] / src / xrdb.c
index ce6e7d21edb15c9858a9f0f557382574d375473c..b4bc11838f063eea7b9e0dbeef25da3fb91c853f 100644 (file)
@@ -1,5 +1,5 @@
 /* Deal with the X Resource Manager.
-   Copyright (C) 1990, 1993-1994, 2000-2015 Free Software Foundation,
+   Copyright (C) 1990, 1993-1994, 2000-2016 Free Software Foundation,
    Inc.
 
 Author: Joseph Arceneaux
@@ -9,8 +9,8 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -177,12 +177,8 @@ magic_db (const char *string, ptrdiff_t string_len, const char *class,
 
       /* Do we have room for this component followed by a '\0'?  */
       if (path_size - path_len <= next_len)
-       {
-         if (min (PTRDIFF_MAX, SIZE_MAX) / 2 - 1 - path_len < next_len)
-           memory_full (SIZE_MAX);
-         path_size = (path_len + next_len + 1) * 2;
-         path = xrealloc (path, path_size);
-       }
+       path = xpalloc (path, &path_size, path_len - path_size + next_len + 1,
+                       -1, sizeof *path);
 
       memcpy (path + path_len, next, next_len);
       path_len += next_len;