about summary refs log tree commit diff stats
path: root/src/common.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix `-Werror=maybe-uninitialized`Steffen Jaeckel2023-05-121-0/+3
| | | | | | | | | | | | | | | When compiling with `CFLAGS="-O2 -fexceptions -Wp,-D_FORTIFY_SOURCE=2"`, as done per default when creating an AUR package e.g. via `makepkg`, this error is produced. Refactor `stanza_create_mam_iq()` in order to fix said warning-turned-into- an-error. Edit by jubalh: I still think the error message is a false positive. But this commit improves the code a lot. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Remove VLA & calm ValgrindSteffen Jaeckel2023-05-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | `MB_CUR_MAX` looks like a macro, but it's a function call and therefore creates a VLA. We don't want that. Also this array being uninitialized created the following Valgrind error ``` ==503529== Conditional jump or move depends on uninitialised value(s) ==503529== at 0x619F15E: waddnstr (lib_addstr.c:67) ==503529== by 0x1929B7: _inp_write (inputwin.c:353) ==503529== by 0x1937D5: _inp_redisplay (inputwin.c:619) ==503529== by 0x61511B1: rl_forced_update_display (display.c:2693) ==503529== by 0x193F9D: _inp_rl_send_to_editor (inputwin.c:957) ==503529== by 0x614642F: _rl_dispatch_subseq (readline.c:916) ==503529== by 0x6146C85: _rl_dispatch_callback (readline.c:823) ==503529== by 0x616739F: rl_callback_read_char (callback.c:241) ==503529== by 0x1923DB: inp_readline (inputwin.c:188) ==503529== by 0x149860: prof_run (profanity.c:117) ==503529== by 0x2283E8: main (main.c:186) ==503529== Uninitialised value was created by a stack allocation ==503529== at 0x1928B1: _inp_write (inputwin.c:334) ``` Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Remove space to match clang coding stylethe xhr2023-01-261-1/+1
|
* Add macro for possible NULL prints and use it on known sportsthe xhr2023-01-261-0/+6
| | | | | The macro is effective on OpenBSD and basically a no op on other platforms. Use it for one existing and the other known debug statements.
* introduce `auto_gcharv`Steffen Jaeckel2023-01-191-0/+2
| | | | | | This also fixes memory leaks in `_omemo_autocomplete()`. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* fix memory leaks in OMEMOSteffen Jaeckel2023-01-181-0/+2
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* add `/strophe` command to modify libstrophe-specific settingsSteffen Jaeckel2023-01-181-1/+8
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Spawn external programs asynchronouslyMarouane L2022-10-121-1/+1
| | | | | | | | Drawback is that we can't check the exitcode anymore. But we were unsure why/when we need this, see: https://github.com/profanity-im/profanity/pull/1760/files#r980868708 Fixes https://github.com/profanity-im/profanity/issues/1759
* use `g_mkdir_with_parents()` instead of home-baked solutionSteffen Jaeckel2022-03-141-2/+1
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Refactor call_externalWilliam Wennerström2020-12-111-2/+2
|
* Use get_expanded_path() in cmd_senfile()Michael Vetter2020-12-091-0/+1
|
* Move unique_filename_from_url functions to commonWilliam Wennerström2020-12-041-0/+2
|
* Refactor for threaded external executable for built-in download methodsWilliam Wennerström2020-12-031-0/+1
|
* Get rid of str_contains()Michael Vetter2020-11-021-1/+0
| | | | We can use strchr() here.
* Apply coding styleMichael Vetter2020-07-071-26/+25
|
* Revert "Apply coding style"Michael Vetter2020-07-071-25/+26
| | | | | | This reverts commit 9b55f2dec0ea27a9ce4856e303425e12f866cea2. Sorting the includes creates some problems.
* Apply coding styleMichael Vetter2020-07-071-26/+25
| | | | Regards https://github.com/profanity-im/profanity/issues/1396
* Get output and error streams from the command spawned by external_call()Pierre Mazière2020-06-031-1/+1
| | | | Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
* Create call_external() helper functionMichael Vetter2020-05-201-0/+2
|
* Remove file_getline() declarationMichael Vetter2020-04-201-1/+0
| | | | Follow up for a6fa8e8e0d6b86c669ac2fb2b7be44812604c21f
* Put getting mentions in own functionMichael Vetter2020-02-201-0/+1
| | | | | | So we can use it somewhere else too. Regards https://github.com/profanity-im/profanity/issues/1261
* Add vim modelineMichael Vetter2019-11-131-0/+1
|
* Move code from jid_random_resource() into own functionMichael Vetter2019-10-161-0/+2
| | | | | Move the code that creates a random string into it's own function +get_random_string().
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
|
* Merge pull request #1011 from jubalh/sha1Michael Vetter2018-09-191-2/+0
|\ | | | | Get rid of p_sha1 dependency
| * Move p_sha1_hash() to stanza.cMichael Vetter2018-09-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Move `p_sha1_hash()` from `common.c` to `xmpp/stanza.c` as it is only used in this file and now depends on libstrophe so xmpp is a better namespace folder. Renaming it as `_stanza_create_sha1_hash()`. And making static since only used here. The function cannot be tested in the unit tests anymore. Once functional tests are working again we should write a test for the sha1 functionality.
* | use gio functions for file copyPhilip Flohr2018-09-061-1/+1
|/
* Move ID generation to xmpp folderMichael Vetter2018-08-301-1/+0
| | | | | | | | | | | create_unique_id() was changed to use UUIDs instead of a counter in the last commit. Since now it depends on connection_create_uuid() which is in the xmpp subfolder the function should also be moved there. Renamed it to connection_create_stanza_id() and moved it to src/xmpp/connection.c. Discussion happened in https://github.com/boothj5/profanity/pull/1010
* Use uuid in create_unique_id instead of counterMichael Vetter2018-08-141-1/+0
| | | | | | | | | | | | Message IDs should be unique so they can be used by XEPs like delivery receipts, chat markers, message correction. So far it used a counter so restarting profanity will cause the counter to be 0 again. Let's rather use an UUID since we have such a function in the xmpp/xmpp.h already. Closes https://github.com/boothj5/profanity/issues/998
* Update copyrightJames Booth2018-01-211-1/+1
|
* Update Glib dependency to 2.40James Booth2017-03-251-20/+0
|
* Allow installing plugins from directoryJames Booth2017-02-051-0/+4
|
* Update CopyrightJames Booth2017-01-281-1/+1
|
* Move window functions to window_list.cJames Booth2016-07-241-3/+1
|
* Move resource conversionsJames Booth2016-07-241-6/+1
|
* Add config/files.cJames Booth2016-07-241-2/+0
|
* Update GPL link in headersJames Booth2016-07-241-1/+1
|
* Add /plugins install commandJames Booth2016-07-121-0/+1
|
* Added whole word matches for room mentionJames Booth2016-04-071-1/+2
|
* Added prof_strstr functionJames Booth2016-04-031-1/+2
|
* Updated copyrightJames Booth2016-02-141-1/+1
|
* Applied coding style to src/James Booth2015-10-261-2/+1
|
* Use consistent style for pointersMichael Vetter2015-10-211-13/+13
|
* Create is_notify_enabled functionMichael Vetter2015-10-121-0/+1
| | | | | The same code was used on two different occasions. I put it into a function.
* Fixed OTR decryption checkJames Booth2015-08-271-1/+1
|
* Added str_contains_str to commonJames Booth2015-08-261-0/+1
|
* I removed ncurses header dependencies, removed unused codeJames Booth2015-06-151-7/+0
|
* Added more connect testsJames Booth2015-05-241-0/+1
|
* Moved _strtoi to common, strtoi_rangeJames Booth2015-03-161-0/+1
|
* Merge branch 'master' into readlineJames Booth2015-02-111-1/+1
|\ | | | | | | | | | | Conflicts: src/tools/history.c src/tools/history.h