aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-12-11 09:41:08 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-12-11 09:41:08 +0100
commit4988e7c5f2ad60c223077ffe83a28b5122c688fd (patch)
tree05249317de6ecb9e5db1ec894ce1a20735b802bf /nx-X11
parentc31cd7737461cdab0dd9f78518147c826d53c606 (diff)
parentcf2e07657e974d443283ce0a401210561ff9236c (diff)
downloadnx-libs-4988e7c5f2ad60c223077ffe83a28b5122c688fd.tar.gz
nx-libs-4988e7c5f2ad60c223077ffe83a28b5122c688fd.tar.bz2
nx-libs-4988e7c5f2ad60c223077ffe83a28b5122c688fd.zip
Merge branch 'sunweaver-pr/drop-NoMachines-own-Xvasprintf-implementation' into 3.6.x
Attributes GH PR #597: https://github.com/ArcticaProject/nx-libs/pull/597 Reviewed+approved by Mihai Moldovan (via IRC): 2017-12-11: ``` 09:38 < Ionic> okay 09:38 < Ionic> in that case it's probably really best to drop it completely ```
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/os/xprintf.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/nx-X11/programs/Xserver/os/xprintf.c b/nx-X11/programs/Xserver/os/xprintf.c
index 2b10e6eba..1aeacad6d 100644
--- a/nx-X11/programs/Xserver/os/xprintf.c
+++ b/nx-X11/programs/Xserver/os/xprintf.c
@@ -89,54 +89,7 @@
#undef TEST
#undef DEBUG
-#define START_SIZE 256
-#define END_SIZE 2048
-
-int
-Xvasprintf(char **ret, const char *_X_RESTRICT_KYWD format, va_list va)
-{
- char *newret;
- int size;
- int r;
-
- size = 0;
-
- for (;;)
- {
- if (size == 0)
- {
- *ret = (char *)malloc(START_SIZE);
- if (*ret == NULL)
- return -1;
- size = START_SIZE;
- }
- else if (size < END_SIZE &&
- (newret = (char *) realloc(*ret, 2 * size)) != NULL)
- {
- *ret = newret;
- size = 2 * size;
- }
- else
- {
- free(*ret);
- return -1;
- }
-
- r = vsnprintf(*ret, size, format, va);
-
- if (r == -1 || r == size || r > size || r == size - 1)
- {
- continue;
- }
- else
- {
- (*ret)[r] = 0;
- return r;
- }
- }
-}
-
-#else
+#endif
/**
* Varargs sprintf that allocates a string buffer the right size for
@@ -171,8 +124,6 @@ Xvasprintf(char **ret, const char *_X_RESTRICT_KYWD format, va_list va)
#endif
}
-#endif
-
#ifndef HAVE_VASPRINTF
#define vasprintf Xvasprintf
#endif