23 Commits

Author SHA1 Message Date
axxel
87e158c23e introduce helper function aprintf(fmt, ...) (#1010)
This replaces the verbose and error prone pattern of calling
    str = malloc(strlen("some value is 12345678"));
    sprintf(str, "some value is %d", val)
with
    str = aprintf(some value is %d", val);


This is similar to the GNU function asprintf() but returns the pointer
instead of assigning it to the first parameter. It uses the existing
gpi_vsnprintf(fmt, va_list) function.
2024-09-12 13:07:52 +02:00
axxel
5c9d7b2759 fix white-space and indentation inconsistencies in ... (#1002)
* examples
 * gphoto2
 * libgphoto2
 * libgphoto2_port

The code (at least in this part of the project) is effectively formated
using tabs with a tab-size of 8 as a means for indentation.

There have been a few places where spaces were introduced. Some obviously
with an indent size of 8 in mind, others with an indent size of 4.

This commit tries its best to make the use of tabs consistent again, at
least for indenting lines. The "intra line" indentation (white space after
the first non-white-space character) is still a bit of a mess.

Co-authored-by: axxel <awagger@web.de>
2024-09-05 09:25:57 +02:00
axxel
1dabc5a523 remove unnecessary if (not-null) check before calling free() (#1001)
Co-authored-by: axxel <awagger@web.de>
2024-09-05 09:25:16 +02:00
luzpaz
dfde313175 Fix various typos in the codebase (#923)
* Fix various typos

Found via `codespell -q 3 -S "*.po" -L clen,donn,informations,udo`

* Fix typos in camlibs/

* Fix typos in ChangeLog
2023-09-03 17:04:21 +02:00
Marcus Meissner
e43230ef45 avoid crash on freed memory 2021-11-28 15:28:37 +01:00
Marcus Meissner
402a43d9af remove memory leaks 2021-08-10 16:28:04 +02:00
Siim Meerits
4d161b4647 Fix examples compilation warnings.
* best-iso.c: Remove or comment out unused variables.
* sample-afl.c: Remove or comment out unused variables.
* sample-capture.c: Fix signed-unsigned compare issue.
* sample-trigger-capture.c: Fix signed-unsigned compare issue.
2020-08-03 08:50:12 +02:00
Siim Meerits
456a1d598b Remove trailing whitespace from all *.h and *.c files. 2020-07-27 17:37:00 +03:00
Marcus Meissner
55b7b003c6 Revert "also test for usbscsi, usbdiskdirect and serial"
This reverts commit dcb34f94e5.

(fixes travis)
2020-05-26 08:16:18 +02:00
Sijawusz Pur Rahnama
fd0be84db5 Fix typos throughout the codebase 2020-05-25 17:55:09 +02:00
Marcus Meissner
dcb34f94e5 also test for usbscsi, usbdiskdirect and serial 2020-03-29 16:12:38 +02:00
Marcus Meissner
8cfca5b2dd fix gp_file reference count usage, its a bit weird 2020-01-25 18:14:16 +01:00
Marcus Meissner
560e15d3f4 let the sample-afl do autodetection to allow fuzzing all USB cameras 2019-04-23 11:48:13 +02:00
Marcus Meissner
9ae48976c5 disable capture fuzzing 2019-01-20 17:34:53 +01:00
Marcus Meissner
2799307539 try more calls 2019-01-20 17:13:03 +01:00
Marcus Meissner
79e7fdb455 unref the context in afl sample 2018-12-21 10:30:15 +01:00
Marcus Meissner
2ea49c29fa also log the domain 2017-07-31 08:11:28 +02:00
Marcus Meissner
9c4aef574b various fixes to free parameters and coverity issues 2017-06-05 19:13:32 +02:00
Marcus Meissner
3ad0c48f38 recursively list directories until the first file is found,
retrieve information and MTP metadata
2017-04-29 13:07:24 +02:00
Marcus Meissner
e366d6a1f0 list folders and files too 2017-04-29 10:16:15 +02:00
Marcus Meissner
f98954b981 add event handling to afl 2016-12-23 18:46:10 +01:00
Marcus Meissner
4950324701 simplified using sample_open_camera 2016-09-25 17:52:08 +02:00
Marcus Meissner
1101b617c3 add a sample program for using AFL without the gphoto2 commandline tool
overhead
2016-09-24 12:12:09 +02:00