aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem/wmem_strutl.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-13Have wmem conform to checkAPIs.plMichael Mann1-1/+2
Yes, the rename of structure members is a bit hacky. Yes, catering to Windows since "GLib's v*printf routines are surprisingly slow on Windows". But it does pass checkAPIs.pl Change-Id: I5b1552472c83aa2e159f17b5b7eb70b37d03eff9 Reviewed-on: https://code.wireshark.org/review/15404 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-09Wmem: Use the native v*printf routines on Windows.Gerald Combs1-0/+32
GLib's v*printf routines are close to unreasonably slow on Windows. Use the native CRT routines in wmem_strdup_vprintf and wmem_strbuf_append_vprintf on that platform. Change-Id: I5e94aa6fe47434e5a18f3a4d5b6b24ebe71499c1 Reviewed-on: https://code.wireshark.org/review/14868 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-17Fix newly optimized strdup_vprintf.Evan Huus1-5/+8
As Jakub pointed out, our +1/-1 logic for null terminators wasn't quite right. Also be sure to re-copy the va_list parameter if we need to re-use it, as otherwise things break oddly. Change-Id: Ibeaa95af602f565791e9378a6cfce434f13025eb Reviewed-on: https://code.wireshark.org/review/1670 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-17Fixes after wmem_strdup_vprintf() optimizationJakub Zawadzki1-7/+7
- g_vsnprintf()[1] buffer size can includes space for terminating NUL, this simplifies code, and fix problems with string truncation - g_vsnprintf() returns number of bytes without terminating NUL, so we need to do + 1 - second g_vsnprintf() call use already consumed 'ap2' va_arg, which makes wmem_strdup_vprintf() doesn't work/ crash for FORMATTED string length > 80 [1] https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-vsnprintf Change-Id: I0ebb7f452e3e89c9b55f8ac889166f02e8a7c982 Reviewed-on: https://code.wireshark.org/review/1667 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-17Use a pre allocated buffer in wmem_strdup_vprintf() reduces the functionAndersBroman1-4/+21
cost by more than half. Change-Id: I6ad2ae407325d2091ffb60919cb3ed74f78f39fa Reviewed-on: https://code.wireshark.org/review/1662 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-25Introduce wmem_ascii_strdown()AndersBroman1-0/+20
Change-Id: Icdc5a0d5033f3ab709fbf19a33ab26f609d4b1f0 Reviewed-on: https://code.wireshark.org/review/824 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-08-14Include config.h first; it defines _FILE_OFFSET_BITS, and if some systemGuy Harris1-2/+2
header later causes it to be redefined - as happens on my Solaris 11 virtual machine - we get a redefinition warning, which gets treated as an error. svn path=/trunk/; revision=51344
2013-06-19Clean up wmem_strsplit to remove a bunch of weird switch statements andEvan Huus1-21/+16
unnecessary continue statements. Should fix the coverity issues Joerg pointed out as well. svn path=/trunk/; revision=50033
2013-06-18Add wmem_alloc_array, wmem_strsplit, wmem_strconcat.Evan Huus1-0/+109
svn path=/trunk/; revision=50017
2013-03-20 From beroset:Bill Meier1-3/+3
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
2012-12-26Fix a bunch of warnings.Guy Harris1-1/+1
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-11-25Add strdup_printf and strdup_vprintf to the wmem string utilities.Evan Huus1-0/+34
svn path=/trunk/; revision=46177
2012-11-08Use const in wmem where possible.Evan Huus1-1/+1
svn path=/trunk/; revision=45976
2012-10-24Basic skeleton for wmem.Evan Huus1-0/+78
https://www.wireshark.org/lists/wireshark-dev/201210/msg00178.html svn path=/trunk/; revision=45746