Update dependencies: lodepng and optparse

This commit is contained in:
2026-04-20 20:13:37 +01:00
parent 0f5a74c123
commit 88c64eaf04
3 changed files with 1058 additions and 369 deletions
+890 -304
View File
File diff suppressed because it is too large Load Diff
+167 -64
View File
@@ -1,7 +1,7 @@
/*
LodePNG version 20221108
LodePNG version 20260119
Copyright (c) 2005-2022 Lode Vandevenne
Copyright (c) 2005-2026 Lode Vandevenne
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -92,7 +92,10 @@ or comment out LODEPNG_COMPILE_ALLOCATORS below*/
#endif
/*Disable built-in CRC function, in that case a custom implementation of
lodepng_crc32 must be defined externally so that it can be linked in.*/
lodepng_crc32 must be defined externally so that it can be linked in.
The default built-in CRC code comes with 8KB of lookup tables, so for memory constrained environment you may want it
disabled and provide a much smaller implementation externally as said above. You can find such an example implementation
in a comment in the lodepng.c(pp) file in the 'else' case of the searchable LODEPNG_COMPILE_CRC section.*/
#ifndef LODEPNG_NO_COMPILE_CRC
/*pass -DLODEPNG_NO_COMPILE_CRC to the compiler to disable the built-in one,
or comment out LODEPNG_COMPILE_CRC below*/
@@ -547,6 +550,18 @@ typedef struct LodePNGInfo {
char** itext_transkeys; /*keyword translated to the international language - UTF-8 string*/
char** itext_strings; /*the actual international text - UTF-8 string*/
/*
Optional exif metadata in exif_size bytes.
Don't allocate this buffer yourself. Use the init/cleanup functions
correctly and use lodepng_set_exif and lodepng_clear_exif.
The exif data is in exif-encoded form but without JPEG markers, starting with the 'II' or 'MM' marker that indicates
endianness. It's up to an exif handling library to encode/decode its information.
*/
unsigned exif_defined; /* Whether exif metadata is present, that is, the PNG image has an eXIf chunk */
unsigned char* exif; /* The bytes of the exif metadata, if present */
unsigned exif_size; /* The size of the exif data in bytes */
/*time chunk (tIME)*/
unsigned time_defined; /*set to 1 to make the encoder generate a tIME chunk*/
LodePNGTime time;
@@ -558,20 +573,34 @@ typedef struct LodePNGInfo {
unsigned phys_unit; /*may be 0 (unknown unit) or 1 (metre)*/
/*
Color profile related chunks: gAMA, cHRM, sRGB, iCPP, sBIT
Color profile related chunk types: cICP, iCPP, sRGB, gAMA, cHRM, sBIT
LodePNG does not apply any color conversions on pixels in the encoder or decoder and does not interpret these color
profile values. It merely passes on the information. If you wish to use color profiles and convert colors, please
use these values with a color management library.
profile values. It merely passes on the information. If you wish to use color profiles and convert colors, a separate
color management library should be used. There is also a limited library for this in lodepng_util.h.
See the PNG, ICC and sRGB specifications for more information about the meaning of these values.
There are 4 types of (sets of) chunks providing color information. If multiple are present, each will be decoded by
LodePNG, but only one should be handled by the user, with the following order of priority depending on what the user
supports:
1: cICP: Coding-independent code points (CICP)
2: iCCP: ICC profile
3: sRGB: indicates the image is in the sRGB color profile
4: gAMA and cHRM: indicates a gamma and chromaticity value to define the color profile
*/
/* gAMA chunk: optional, overridden by sRGB or iCCP if those are present. */
/*
gAMA chunk: Image gamma
Optional, overridden by cICP, iCCP or sRGB if those are present.
Together with cHRM, this is a primitive way of specifying the image color profile.
*/
unsigned gama_defined; /* Whether a gAMA chunk is present (0 = not present, 1 = present). */
unsigned gama_gamma; /* Gamma exponent times 100000 */
/* cHRM chunk: optional, overridden by sRGB or iCCP if those are present. */
/*
cHRM chunk: Primary chromaticities and white point
Optional, overridden by cICP, iCCP or sRGB if those are present.
Together with gAMA, this is a primitive way of specifying the image color profile.
*/
unsigned chrm_defined; /* Whether a cHRM chunk is present (0 = not present, 1 = present). */
unsigned chrm_white_x; /* White Point x times 100000 */
unsigned chrm_white_y; /* White Point y times 100000 */
@@ -583,7 +612,8 @@ typedef struct LodePNGInfo {
unsigned chrm_blue_y; /* Blue y times 100000 */
/*
sRGB chunk: optional. May not appear at the same time as iCCP.
sRGB chunk: Indicates the image is in the sRGB color space.
Optional. Should not appear at the same time as iCCP.
If gAMA is also present gAMA must contain value 45455.
If cHRM is also present cHRM must contain respectively 31270,32900,64000,33000,30000,60000,15000,6000.
*/
@@ -591,22 +621,25 @@ typedef struct LodePNGInfo {
unsigned srgb_intent; /* Rendering intent: 0=perceptual, 1=rel. colorimetric, 2=saturation, 3=abs. colorimetric */
/*
iCCP chunk: optional. May not appear at the same time as sRGB.
iCCP chunk: Embedded ICC profile.
Optional. Should not appear at the same time as sRGB.
LodePNG does not parse or use the ICC profile (except its color space header field for an edge case), a
separate library to handle the ICC data (not included in LodePNG) format is needed to use it for color
Contains ICC profile, which can use any version of the ICC.1 specification by the International Color Consortium. See
its specification for more details. LodePNG does not parse or use the ICC profile (except its color space header
field for "RGB" or "GRAY", see below), a separate library to handle the ICC data format is needed to use it for color
management and conversions.
For encoding, if iCCP is present, gAMA and cHRM are recommended to be added as well with values that match the ICC
profile as closely as possible, if you wish to do this you should provide the correct values for gAMA and cHRM and
enable their '_defined' flags since LodePNG will not automatically compute them from the ICC profile.
For encoding, if iCCP is present, the PNG specification recommends to also add gAMA and cHRM chunks that approximate
the ICC profile, for compatibility with applications that don't use the ICC chunk. This is not required, and it's up
to the user to compute approximate values and set then in the appropriate gama_ and chrm_ fields, LodePNG does not do
this automatically since it does not interpret the ICC profile.
For encoding, the ICC profile is required by the PNG specification to be an "RGB" profile for non-gray
PNG color types and a "GRAY" profile for gray PNG color types. If you disable auto_convert, you must ensure
the ICC profile type matches your requested color type, else the encoder gives an error. If auto_convert is
enabled (the default), and the ICC profile is not a good match for the pixel data, this will result in an encoder
error if the pixel data has non-gray pixels for a GRAY profile, or a silent less-optimal compression of the pixel
data if the pixels could be encoded as grayscale but the ICC profile is RGB.
For encoding, the ICC profile is required by the PNG specification to be an "RGB" profile for non-gray PNG color
types (types 2, 3 and 6) and a "GRAY" profile for gray PNG color types (types 1 and 4). If you disable auto_convert,
you must ensure the ICC profile type matches your requested color type, else the encoder gives an error. If
auto_convert is enabled (the default), and the ICC profile is not a correct match for the pixel data, this will result
in an encoder error if the pixel data has non-gray pixels for a GRAY profile, or a silent less-optimal compression of
the pixel data if the pixels could be encoded as grayscale but the ICC profile is RGB.
To avoid this do not set an ICC profile in the image unless there is a good reason for it, and when doing so
make sure you compute it carefully to avoid the above problems.
@@ -622,7 +655,58 @@ typedef struct LodePNGInfo {
unsigned iccp_profile_size; /* The size of iccp_profile in bytes */
/*
sBIT chunk: significant bits. Optional metadata, only set this if needed.
cICP chunk: Coding-independent code points for video signal type identification.
Optional. If present, and supported, overrides iCCP, sRGB, gAMA and cHRM.
The meaning of the values are as defined in the specification ITU-T-H.273. LodePNG does not
use these values, only passes on the metadata. The meaning of the values is they are enum
values representing certain color spaces, including HDR color spaces, such as Display P3,
PQ and HLG. The video full range flag value should typically be 1 for the use cases of PNG
images, but can be 0 for narrow-range images in certain video editing workflows.
*/
unsigned cicp_defined; /* Whether an cICP chunk is present (0 = not present, 1 = present). */
unsigned cicp_color_primaries; /* Colour primaries value */
unsigned cicp_transfer_function; /* Transfer characteristics value */
unsigned cicp_matrix_coefficients; /* Matrix coefficients value */
unsigned cicp_video_full_range_flag; /* Video full range flag value */
/*
mDCV chunk: Mastering Display Color Volume.
Optional, typically used in conjunction with certain HDR color spaces that can
be represented by the cICP chunk.
See the PNG specification, third edition, for more information on this chunk.
All the red, green, blue and white x and y values are encoded as 16-bit
integers and therefore must be in range 0-65536. The min and max luminance
values are 32-bit integers.
*/
unsigned mdcv_defined; /* Whether an mDCV chunk is present (0 = not present, 1 = present). */
/* Mastering display color primary chromaticities (CIE 1931 x,y of R,G,B) */
unsigned mdcv_red_x; /* Red x times 50000 */
unsigned mdcv_red_y; /* Red y times 50000 */
unsigned mdcv_green_x; /* Green x times 50000 */
unsigned mdcv_green_y; /* Green y times 50000 */
unsigned mdcv_blue_x; /* Blue x times 50000 */
unsigned mdcv_blue_y; /* Blue y times 50000 */
/* Mastering display white point chromaticity (CIE 1931 x,y) */
unsigned mdcv_white_x; /* White Point x times 50000 */
unsigned mdcv_white_y; /* White Point y times 50000 */
/* Mastering display luminance */
unsigned mdcv_max_luminance; /* Max luminance in cd/m^2 times 10000 */
unsigned mdcv_min_luminance; /* Min luminance in cd/m^2 times 10000 */
/*
cLLI chunk: Content Light Level Information.
Optional, typically used in conjunction with certain HDR color spaces that can
be represented by the cICP chunk.
See the PNG specification, third edition, for more information on this chunk.
The clli_max_cll and clli_max_fall values are 32-bit integers.
*/
unsigned clli_defined; /* Whether a cLLI chunk is present (0 = not present, 1 = present). */
unsigned clli_max_cll; /* Maximum Content Light Level (MaxCLL) in cd/m^2 times 10000 */
unsigned clli_max_fall; /* Maximum Frame-Average Light Level (MaxFALL) in cd/m^2 times 10000 */
/*
sBIT chunk: significant bits.
Optional metadata, only set this if needed.
If defined, these values give the bit depth of the original data. Since PNG only stores 1, 2, 4, 8 or 16-bit
per channel data, the significant bits value can be used to indicate the original encoded data has another
@@ -687,6 +771,7 @@ typedef struct LodePNGInfo {
/*init, cleanup and copy functions to use with this struct*/
void lodepng_info_init(LodePNGInfo* info);
/*destructs the LodePNGInfo and brings it to invalid state, requiring lodepng_info_init again before reusing it*/
void lodepng_info_cleanup(LodePNGInfo* info);
/*return value is error code (0 means no error)*/
unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source);
@@ -701,7 +786,11 @@ void lodepng_clear_itext(LodePNGInfo* info); /*use this to clear the itexts agai
/*replaces if exists*/
unsigned lodepng_set_icc(LodePNGInfo* info, const char* name, const unsigned char* profile, unsigned profile_size);
void lodepng_clear_icc(LodePNGInfo* info); /*use this to clear the texts again after you filled them in*/
void lodepng_clear_icc(LodePNGInfo* info); /*use this to clear the profile again after you filled it in*/
/*replaces if exists*/
unsigned lodepng_set_exif(LodePNGInfo* info, const unsigned char* exif, unsigned exif_size);
void lodepng_clear_exif(LodePNGInfo* info); /*use this to clear the exif metadata again after you filled it in*/
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
/*
@@ -734,7 +823,7 @@ typedef struct LodePNGDecoderSettings {
/* TODO: make a system involving warnings with levels and a strict mode instead. Other potentially recoverable
errors: srgb rendering intent value, size of content of ancillary chunks, more than 79 characters for some
strings, placement/combination rules for ancillary chunks, crc of unknown chunks, allowed characters
in string keys, etc... */
in string keys, invalid characters in chunk types names, etc... */
unsigned color_convert; /*whether to convert the PNG to the color type you want. Default: yes*/
@@ -760,7 +849,8 @@ void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings);
#endif /*LODEPNG_COMPILE_DECODER*/
#ifdef LODEPNG_COMPILE_ENCODER
/*automatically use color type with less bits per pixel if losslessly possible. Default: AUTO*/
/*strategy to use to choose the PNG filter per scanline. Strategies 0-4 correspond
to each of the 5 filter types PNG supports, the next values are adaptive strategies*/
typedef enum LodePNGFilterStrategy {
/*every filter at zero*/
LFS_ZERO = 0,
@@ -769,7 +859,8 @@ typedef enum LodePNGFilterStrategy {
LFS_TWO = 2,
LFS_THREE = 3,
LFS_FOUR = 4,
/*Use filter that gives minimum sum, as described in the official PNG filter heuristic.*/
/*Use the filter out of the 5 above types that gives minimum sum, by trying each one. This is the adaptive filtering
suggested heuristic in the PNG standard chapter 'Filter selection'.*/
LFS_MINSUM,
/*Use the filter type that gives smallest Shannon entropy for this scanline. Depending
on the image, this is better or worse than minsum.*/
@@ -815,12 +906,15 @@ unsigned lodepng_compute_color_stats(LodePNGColorStats* stats,
typedef struct LodePNGEncoderSettings {
LodePNGCompressSettings zlibsettings; /*settings for the zlib encoder, such as window size, ...*/
unsigned auto_convert; /*automatically choose output PNG color type. Default: true*/
/*automatically choose output PNG color type. If false, must explicitly choose the output color
type in state.info_png.color.colortype, info_png.color.bitdepth and optionally its palette.
Default: true*/
unsigned auto_convert;
/*If true, follows the official PNG heuristic: if the PNG uses a palette or lower than
8 bit depth, set all filters to zero. Otherwise use the filter_strategy. Note that to
completely follow the official PNG heuristic, filter_palette_zero must be true and
filter_strategy must be LFS_MINSUM*/
/*If true, follows the suggestion in the PNG standard in chapter 'Filter selection': if the PNG uses
a palette or lower than 8 bit depth, set all filters to zero.
In other cases this will use the heuristic from the chosen filter_strategy. The PNG standard
suggests LFS_MINSUM for those cases.*/
unsigned filter_palette_zero;
/*Which filter strategy to use when not using zeroes due to filter_palette_zero.
Set filter_palette_zero to 0 to ensure always using your chosen strategy. Default: LFS_MINSUM*/
@@ -832,7 +926,7 @@ typedef struct LodePNGEncoderSettings {
const unsigned char* predefined_filters;
/*force creating a PLTE chunk if colortype is 2 or 6 (= a suggested palette).
If colortype is 3, PLTE is always created. If color type is explicitely set
If colortype is 3, PLTE is always created. If color type is explicitly set
to a grayscale type (1 or 4), this is not done and is ignored. If enabling this,
a palette must be present in the info_png.
NOTE: enabling this may worsen compression if auto_convert is used to choose
@@ -851,7 +945,17 @@ void lodepng_encoder_settings_init(LodePNGEncoderSettings* settings);
#if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER)
/*The settings, state and information for extended encoding and decoding.*/
/*The settings, state and information for extended encoding and decoding.
Using this struct requires using lodepng_state_init to initialize it
and using lodepng_state_cleanup to deconstruct it. If using C++, you can
use lodepng::State instead which does those things automatically with RAII.
While a LodePNGState can be reused once in a chain of lodepng_decode followed by
lodepng_encode, it's not recommended to reuse it for multiple encode, decode
or inspect calls, and if any such function returns an error code, the
LodePNGState should not be reused at all as it can be in an unexpected state..
*/
typedef struct LodePNGState {
#ifdef LODEPNG_COMPILE_DECODER
LodePNGDecoderSettings decoder; /*the decoding settings*/
@@ -861,13 +965,15 @@ typedef struct LodePNGState {
#endif /*LODEPNG_COMPILE_ENCODER*/
LodePNGColorMode info_raw; /*specifies the format in which you would like to get the raw pixel buffer*/
LodePNGInfo info_png; /*info of the PNG image obtained after decoding*/
unsigned error;
unsigned error; /*deprecated, use the return value of the encode/decode functions to check errors instead*/
} LodePNGState;
/*init, cleanup and copy functions to use with this struct*/
void lodepng_state_init(LodePNGState* state);
/*destructs the LodePNGState and brings it to invalid state, requiring lodepng_info_init again before reusing it*/
void lodepng_state_cleanup(LodePNGState* state);
void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source);
/*return value is error code (0 means no error)*/
unsigned lodepng_state_copy(LodePNGState* dest, const LodePNGState* source);
#endif /* defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) */
#ifdef LODEPNG_COMPILE_DECODER
@@ -996,9 +1102,9 @@ unsigned lodepng_chunk_append(unsigned char** out, size_t* outsize, const unsign
Appends new chunk to out. The chunk to append is given by giving its length, type
and data separately. The type is a 4-letter string.
The out variable and outsize are updated to reflect the new reallocated buffer.
Returne error code (0 if it went ok)
Returns error code (0 if it went ok)
*/
unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, unsigned length,
unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, size_t length,
const char* type, const unsigned char* data);
@@ -1090,6 +1196,8 @@ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const
/* The LodePNG C++ wrapper uses std::vectors instead of manually allocated memory buffers. */
namespace lodepng {
#ifdef LODEPNG_COMPILE_PNG
/* Wrapper around LodePNGState, which automatically calls lodepng_state_init in the constructor
and lodepng_state_cleanup in the desctructor.*/
class State : public LodePNGState {
public:
State();
@@ -1169,7 +1277,8 @@ TODO:
[.] check compatibility with various compilers - done but needs to be redone for every newer version
[X] converting color to 16-bit per channel types
[X] support color profile chunk types (but never let them touch RGB values by default)
[ ] support all public PNG chunk types (almost done except sPLT and hIST)
[ ] support all second edition public PNG chunk types (almost done except sPLT and hIST)
[X] support non-animation third edition public PNG chunk types: eXIf, cICP, mDCV, cLLI
[ ] make sure encoder generates no chunks with size > (2^31)-1
[ ] partial decoding (stream processing)
[X] let the "isFullyOpaque" function check color keys and transparent palettes too
@@ -1871,7 +1980,7 @@ state.decoder.remember_unknown_chunks: whether to read in unknown chunks
state.info_raw.colortype: desired color type for decoded image
state.info_raw.bitdepth: desired bit depth for decoded image
state.info_raw....: more color settings, see struct LodePNGColorMode
state.info_png....: no settings for decoder but ouput, see struct LodePNGInfo
state.info_png....: no settings for decoder but output, see struct LodePNGInfo
For encoding:
@@ -1909,12 +2018,21 @@ symbol.
Not all changes are listed here, the commit history in github lists more:
https://github.com/lvandeve/lodepng
*) 6 may 2025 (!): renamed mDCv to mDCV and cLLi to cLLI as per the recent
rename in the draft png third edition spec. Please note that as long as the
third edition is not finalized, backwards-incompatible changes to its
features are possible.
*) 23 dec 2024: added support for the mDCv and cLLi chunks (for png third
edition spec)
*) 22 dec 2024: added support for the cICP chunk (for png third edition spec)
*) 15 dec 2024: added support for the eXIf chunk (for png third edition spec)
*) 10 apr 2023: faster CRC32 implementation, but with larger lookup table.
*) 13 jun 2022: added support for the sBIT chunk.
*) 09 jan 2022: minor decoder speed improvements.
*) 27 jun 2021: added warnings that file reading/writing functions don't support
wide-character filenames (support for this is not planned, opening files is
not the core part of PNG decoding/decoding and is platform dependent).
*) 17 okt 2020: prevent decoding too large text/icc chunks by default.
*) 17 oct 2020: prevent decoding too large text/icc chunks by default.
*) 06 mar 2020: simplified some of the dynamic memory allocations.
*) 12 jan 2020: (!) added 'end' argument to lodepng_chunk_next to allow correct
overflow checks.
@@ -1936,7 +2054,7 @@ https://github.com/lvandeve/lodepng
*) 09 apr 2016: Fixed colorkey usage detection, and better file loading (within
the limits of pure C90).
*) 08 dec 2015: Made load_file function return error if file can't be opened.
*) 24 okt 2015: Bugfix with decoding to palette output.
*) 24 oct 2015: Bugfix with decoding to palette output.
*) 18 apr 2015: Boundary PM instead of just package-merge for faster encoding.
*) 24 aug 2014: Moved to github
*) 23 aug 2014: Reduced needless memory usage of decoder.
@@ -1950,8 +2068,8 @@ https://github.com/lvandeve/lodepng
prefix for the custom allocators and made it possible with a new #define to
use custom ones in your project without needing to change lodepng's code.
*) 28 jan 2013: Bugfix with color key.
*) 27 okt 2012: Tweaks in text chunk keyword length error handling.
*) 8 okt 2012: (!) Added new filter strategy (entropy) and new auto color mode.
*) 27 oct 2012: Tweaks in text chunk keyword length error handling.
*) 8 oct 2012: (!) Added new filter strategy (entropy) and new auto color mode.
(no palette). Better deflate tree encoding. New compression tweak settings.
Faster color conversions while decoding. Some internal cleanups.
*) 23 sep 2012: Reduced warnings in Visual Studio a little bit.
@@ -1967,7 +2085,7 @@ https://github.com/lvandeve/lodepng
*) 6 nov 2011: (!) By default, the encoder now automatically chooses the best
PNG color model and bit depth, based on the amount and type of colors of the
raw image. For this, autoLeaveOutAlphaChannel replaced by auto_choose_color.
*) 9 okt 2011: simpler hash chain implementation for the encoder.
*) 9 oct 2011: simpler hash chain implementation for the encoder.
*) 8 sep 2011: lz77 encoder lazy matching instead of greedy matching.
*) 23 aug 2011: tweaked the zlib compression parameters after benchmarking.
A bug with the PNG filtertype heuristic was fixed, so that it chooses much
@@ -1982,8 +2100,8 @@ https://github.com/lvandeve/lodepng
*) 13 nov 2010: added LodePNG_InfoColor_hasPaletteAlpha and
LodePNG_InfoColor_canHaveAlpha functions for convenience.
*) 7 nov 2010: added LodePNG_error_text function to get error code description.
*) 30 okt 2010: made decoding slightly faster
*) 26 okt 2010: (!) changed some C function and struct names (more consistent).
*) 30 oct 2010: made decoding slightly faster
*) 26 oct 2010: (!) changed some C function and struct names (more consistent).
Reorganized the documentation and the declaration order in the header.
*) 08 aug 2010: only changed some comments and external samples.
*) 05 jul 2010: fixed bug thanks to warnings in the new gcc version.
@@ -2042,8 +2160,8 @@ https://github.com/lvandeve/lodepng
Removed some code duplication in the decoder. Fixed little bug in an example.
*) 09 dec 2006: (!) Placed output parameters of public functions as first parameter.
Fixed a bug of the decoder with 16-bit per color.
*) 15 okt 2006: Changed documentation structure
*) 09 okt 2006: Encoder class added. It encodes a valid PNG image from the
*) 15 oct 2006: Changed documentation structure
*) 09 oct 2006: Encoder class added. It encodes a valid PNG image from the
given image buffer, however for now it's not compressed.
*) 08 sep 2006: (!) Changed to interface with a Decoder class
*) 30 jul 2006: (!) LodePNG_InfoPng , width and height are now retrieved in different
@@ -2067,19 +2185,4 @@ https://github.com/lvandeve/lodepng
*) 22 apr 2006: Optimized and improved some code
*) 07 sep 2005: (!) Changed to std::vector interface
*) 12 aug 2005: Initial release (C++, decoder only)
13. contact information
-----------------------
Feel free to contact me with suggestions, problems, comments, ... concerning
LodePNG. If you encounter a PNG image that doesn't work properly with this
decoder, feel free to send it and I'll use it to find and fix the problem.
My email address is (puzzle the account and domain together with an @ symbol):
Domain: gmail dot com.
Account: lode dot vandevenne.
Copyright (c) 2005-2022 Lode Vandevenne
*/
+1 -1
View File
@@ -288,7 +288,7 @@ optparse_from_long(const struct optparse_long *longopts, char *optstring)
for (i = 0; !optparse_longopts_end(longopts, i); i++) {
if (longopts[i].shortname && longopts[i].shortname < 127) {
int a;
*p++ = longopts[i].shortname;
*p++ = (char)longopts[i].shortname;
for (a = 0; a < (int)longopts[i].argtype; a++)
*p++ = ':';
}