fixed the SPACE_LEFT macro to not underflow, suggested by Axel
https://github.com/gphoto/libgphoto2/pull/113
This commit is contained in:
@@ -5173,7 +5173,7 @@ camera_summary (Camera* camera, CameraText* summary, GPContext *context)
|
||||
|
||||
txt = summary->text;
|
||||
|
||||
#define SPACE_LEFT (summary->text + sizeof (summary->text) - txt)
|
||||
#define SPACE_LEFT max(0, summary->text + sizeof (summary->text) - txt)
|
||||
#define APPEND_TXT( ... ) txt += snprintf (txt, SPACE_LEFT, __VA_ARGS__)
|
||||
|
||||
APPEND_TXT (_("Manufacturer: %s\n"),params->deviceinfo.Manufacturer);
|
||||
|
||||
Reference in New Issue
Block a user