Compare commits

...
Author SHA1 Message Date
deepend 479f1649ef Bump release metadata to 2.18.1 2026-05-21 18:11:33 -06:00
deepend-tildeclub 06f69184b6 Merge pull request #239 from ZoiteChat/size_t_int_fixes
Size t int fixes
2026-05-21 17:10:07 -06:00
deepend-tildeclub 3471d9a57c Merge pull request #241 from ZoiteChat/win32-relax-arch-check
Use x64compatible for Windows installer arch checks
2026-05-21 17:09:51 -06:00
deepend 28d4035477 Use x64compatible for Windows installer arch checks 2026-05-21 02:50:49 -06:00
deepend-tildeclub 3e1d151efd Merge pull request #240 from ZoiteChat/win32-dependency-update
Use new GTK3 bundle zip in Windows CI
2026-05-21 02:21:51 -06:00
deepend 556cfc3036 Use new GTK3 bundle zip in Windows CI 2026-05-20 21:25:37 -06:00
deepend c49b757be6 Clamp Win32 sysinfo UTF length casts 2026-05-20 15:51:07 -06:00
deepend cec7e2caf3 Use size_t for strlen length temporaries 2026-05-20 15:34:19 -06:00
deepend 9a0c07a461 Clean up Win32 size/length casts 2026-05-20 15:22:06 -06:00
deepend c7064c18b9 Clamp spell-provider length casts on Win32 2026-05-20 14:51:06 -06:00
18 changed files with 91 additions and 24 deletions
+2 -2
View File
@@ -65,8 +65,8 @@ jobs:
Download-WithRetry -Url https://github.com/jrsoftware/issrc/releases/download/is-6_7_1/innosetup-6.7.1.exe -OutFile deps\innosetup-unicode.exe Download-WithRetry -Url https://github.com/jrsoftware/issrc/releases/download/is-6_7_1/innosetup-6.7.1.exe -OutFile deps\innosetup-unicode.exe
& deps\innosetup-unicode.exe /VERYSILENT | Out-Null & deps\innosetup-unicode.exe /VERYSILENT | Out-Null
Download-WithRetry -Url https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.0-pre1/GTK3_Gvsbuild_zoitechat-2.18.0-pre1_${{ matrix.platform }}.7z -OutFile deps\gtk-${{ matrix.arch }}.7z Download-WithRetry -Url https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.1/GTK3_Gvsbuild_zoitechat-2.18.1_x64.zip -OutFile deps\gtk-${{ matrix.arch }}.zip
& 7z.exe x deps\gtk-${{ matrix.arch }}.7z -oC:\gtk-build\gtk\x64\release Expand-Archive -LiteralPath deps\gtk-${{ matrix.arch }}.zip -DestinationPath C:\gtk-build\gtk\x64\release -Force
Download-WithRetry -Url https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-hicolor-icon-theme-0.18-1-any.pkg.tar.zst -OutFile deps\hicolor-icon-theme.pkg.tar.zst Download-WithRetry -Url https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-hicolor-icon-theme-0.18-1-any.pkg.tar.zst -OutFile deps\hicolor-icon-theme.pkg.tar.zst
python -c "import tarfile,zstandard,pathlib;archive=pathlib.Path(r'deps\\hicolor-icon-theme.pkg.tar.zst');target=pathlib.Path(r'C:\\gtk-build\\gtk\\x64\\release');dctx=zstandard.ZstdDecompressor();f=archive.open('rb');reader=dctx.stream_reader(f);tf=tarfile.open(fileobj=reader,mode='r|');[tf.extract(m,path=target) for m in tf if m.name.startswith('mingw64/share/icons/hicolor/')];tf.close();reader.close();f.close()" python -c "import tarfile,zstandard,pathlib;archive=pathlib.Path(r'deps\\hicolor-icon-theme.pkg.tar.zst');target=pathlib.Path(r'C:\\gtk-build\\gtk\\x64\\release');dctx=zstandard.ZstdDecompressor();f=archive.open('rb');reader=dctx.stream_reader(f);tf=tarfile.open(fileobj=reader,mode='r|');[tf.extract(m,path=target) for m in tf if m.name.startswith('mingw64/share/icons/hicolor/')];tf.close();reader.close();f.close()"
+22
View File
@@ -1,7 +1,28 @@
ZoiteChat ChangeLog ZoiteChat ChangeLog
================= =================
2.18.1 (2026-05-21)
-------------------
- Migrated D-Bus handling to GDBus.
- Enabled mouse wheel channel switching by default and consumed handled tab wheel events.
- Switched main panes to native GTK scrollbars.
- Tightened userlist button and meter layout.
- Made the native Windows file chooser modal.
- Set the Windows AppUserModelID before GTK startup.
- Updated Windows CI to use the new GTK3 bundle zip.
- Updated Windows installer architecture checks to use x64-compatible detection.
- Bumped the Flatpak Perl runtime to 5.42.2.
- Fixed palette color reads to preserve base GTK state.
- Fixed auto-replace whole-word matching.
- Fixed checksum file stream cleanup.
- Fixed byte handling in the Python console.
- Guarded GTK drag-and-drop handlers against null windows.
- Fixed size_t and integer handling issues.
- Removed the Winamp plugin.
2.18.0 (2026-04-20) 2.18.0 (2026-04-20)
-------------------
- Added optional close buttons on tabs. - Added optional close buttons on tabs.
- Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs. - Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs.
@@ -19,6 +40,7 @@ ZoiteChat ChangeLog
- Improved AppStream metainfo validation. - Improved AppStream metainfo validation.
2.18.0~pre6 (2026-03-30) 2.18.0~pre6 (2026-03-30)
------------------------
- Applied app theme CSS to the menubar consistently across the app. - Applied app theme CSS to the menubar consistently across the app.
- Restored horizontal separator lines in menus. - Restored horizontal separator lines in menus.
@@ -29,6 +29,28 @@
<id>zoitechat.desktop</id> <id>zoitechat.desktop</id>
</provides> </provides>
<releases> <releases>
<release date="2026-05-21" version="2.18.1">
<description>
<ul>
<li>Migrated D-Bus handling to GDBus.</li>
<li>Enabled mouse wheel channel switching by default and consumed handled tab wheel events.</li>
<li>Switched main panes to native GTK scrollbars.</li>
<li>Tightened userlist button and meter layout.</li>
<li>Made the native Windows file chooser modal.</li>
<li>Set the Windows AppUserModelID before GTK startup.</li>
<li>Updated Windows CI to use the new GTK3 bundle zip.</li>
<li>Updated Windows installer architecture checks to use x64-compatible detection.</li>
<li>Bumped the Flatpak Perl runtime to 5.42.2.</li>
<li>Fixed palette color reads to preserve base GTK state.</li>
<li>Fixed auto-replace whole-word matching.</li>
<li>Fixed checksum file stream cleanup.</li>
<li>Fixed byte handling in the Python console.</li>
<li>Guarded GTK drag-and-drop handlers against null windows.</li>
<li>Fixed size_t and integer handling issues.</li>
<li>Removed the Winamp plugin.</li>
</ul>
</description>
</release>
<release date="2026-04-20" version="2.18.0"> <release date="2026-04-20" version="2.18.0">
<description> <description>
<p>Tabs and navigation:</p> <p>Tabs and navigation:</p>
+1 -1
View File
@@ -1,5 +1,5 @@
project('zoitechat', 'c', project('zoitechat', 'c',
version: '2.18.0', version: '2.18.1',
meson_version: '>= 0.55.0', meson_version: '>= 0.55.0',
default_options: [ default_options: [
'c_std=c17', 'c_std=c17',
+1 -1
View File
@@ -19,7 +19,7 @@ else:
if not hasattr(sys, 'argv'): if not hasattr(sys, 'argv'):
sys.argv = ['<zoitechat>'] sys.argv = ['<zoitechat>']
VERSION = b'2.18.0' VERSION = b'2.18.1'
PLUGIN_NAME = ffi.new('char[]', b'Python') PLUGIN_NAME = ffi.new('char[]', b'Python')
PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1])) PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1]))
PLUGIN_VERSION = ffi.new('char[]', VERSION) PLUGIN_VERSION = ffi.new('char[]', VERSION)
+1 -1
View File
@@ -4397,7 +4397,7 @@ void
check_special_chars (char *cmd, int do_ascii) /* check for %X */ check_special_chars (char *cmd, int do_ascii) /* check for %X */
{ {
int occur = 0; int occur = 0;
int len = strlen (cmd); size_t len = strlen (cmd);
char *buf, *utf; char *buf, *utf;
char tbuf[4]; char tbuf[4];
int i = 0, j = 0; int i = 0, j = 0;
+1 -1
View File
@@ -1017,7 +1017,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
char *account; char *account;
char ip[128], nick[NICKLEN]; char ip[128], nick[NICKLEN];
char *text, *ex; char *text, *ex;
int len = strlen (type); size_t len = strlen (type);
/* fill in the "ip" and "nick" buffers */ /* fill in the "ip" and "nick" buffers */
ex = strchr (word[1], '!'); ex = strchr (word[1], '!');
+17 -2
View File
@@ -22,6 +22,7 @@
#include <ctype.h> #include <ctype.h>
#include <inttypes.h> #include <inttypes.h>
#include <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
@@ -74,6 +75,18 @@ typedef struct
static bool string_builder_init (StringBuilder *builder); static bool string_builder_init (StringBuilder *builder);
static void string_builder_free (StringBuilder *builder); static void string_builder_free (StringBuilder *builder);
static bool string_builder_append (StringBuilder *builder, const char *text); static bool string_builder_append (StringBuilder *builder, const char *text);
static int size_to_int (size_t value);
static int
size_to_int (size_t value)
{
if (value > (size_t) INT_MAX)
{
return INT_MAX;
}
return (int) value;
}
char * char *
sysinfo_get_cpu (void) sysinfo_get_cpu (void)
@@ -511,6 +524,7 @@ static char *read_hdd_info (IWbemClassObject *object)
static char *bstr_to_utf8 (BSTR bstr) static char *bstr_to_utf8 (BSTR bstr)
{ {
int utf8_len; int utf8_len;
int wide_len;
char *utf8; char *utf8;
if (bstr == NULL) if (bstr == NULL)
@@ -518,7 +532,8 @@ static char *bstr_to_utf8 (BSTR bstr)
return NULL; return NULL;
} }
utf8_len = WideCharToMultiByte (CP_UTF8, 0, bstr, SysStringLen (bstr), NULL, 0, NULL, NULL); wide_len = size_to_int ((size_t) SysStringLen (bstr));
utf8_len = WideCharToMultiByte (CP_UTF8, 0, bstr, wide_len, NULL, 0, NULL, NULL);
if (utf8_len <= 0) if (utf8_len <= 0)
{ {
return NULL; return NULL;
@@ -530,7 +545,7 @@ static char *bstr_to_utf8 (BSTR bstr)
return NULL; return NULL;
} }
if (WideCharToMultiByte (CP_UTF8, 0, bstr, SysStringLen (bstr), utf8, utf8_len, NULL, NULL) <= 0) if (WideCharToMultiByte (CP_UTF8, 0, bstr, wide_len, utf8, utf8_len, NULL, NULL) <= 0)
{ {
free (utf8); free (utf8);
return NULL; return NULL;
+1 -1
View File
@@ -321,7 +321,7 @@ url_check_line (char *buf)
for (i = 0; i < ARRAY_SIZE (commands); i++) for (i = 0; i < ARRAY_SIZE (commands); i++)
{ {
char *cmd = commands[i]; char *cmd = commands[i];
int len = strlen (cmd); size_t len = strlen (cmd);
if (strncmp (cmd, po, len) == 0) if (strncmp (cmd, po, len) == 0)
{ {
+1 -1
View File
@@ -98,7 +98,7 @@ path_part (char *file, char *path, int pathlen)
char * /* like strstr(), but nocase */ char * /* like strstr(), but nocase */
nocasestrstr (const char *s, const char *wanted) nocasestrstr (const char *s, const char *wanted)
{ {
register const int len = strlen (wanted); register const size_t len = strlen (wanted);
if (len == 0) if (len == 0)
return (char *)s; return (char *)s;
+1 -1
View File
@@ -452,7 +452,7 @@ void
fe_add_chan_list (server *serv, char *chan, char *users, char *topic) fe_add_chan_list (server *serv, char *chan, char *users, char *topic)
{ {
chanlistrow *next_row; chanlistrow *next_row;
int len = strlen (chan) + 1; size_t len = strlen (chan) + 1;
/* we allocate the struct and channel string in one go */ /* we allocate the struct and channel string in one go */
next_row = g_malloc (sizeof (chanlistrow) + len); next_row = g_malloc (sizeof (chanlistrow) + len);
+1 -1
View File
@@ -976,7 +976,7 @@ gtkutil_copy_to_clipboard (GtkWidget *widget, GdkAtom selection,
win = gtk_widget_get_toplevel (GTK_WIDGET (widget)); win = gtk_widget_get_toplevel (GTK_WIDGET (widget));
if (gtk_widget_is_toplevel (win)) if (gtk_widget_is_toplevel (win))
{ {
int len = strlen (str); gint len = (gint) strlen (str);
if (selection) if (selection)
{ {
+2 -2
View File
@@ -2309,7 +2309,7 @@ menu_reorder (GtkMenu *menu, GtkWidget *item, int pos)
if (pos < 0) /* position offset from end/bottom */ if (pos < 0) /* position offset from end/bottom */
{ {
GList *children = gtk_container_get_children (GTK_CONTAINER (menu)); GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
int length = g_list_length (children); gint length = (gint) g_list_length (children);
g_list_free (children); g_list_free (children);
gtk_menu_reorder_child (menu, item, (length + pos) - 1); gtk_menu_reorder_child (menu, item, (length + pos) - 1);
@@ -2381,7 +2381,7 @@ menu_add_sub (GtkWidget *menu, menu_entry *me)
if (pos < 0) /* position offset from end/bottom */ if (pos < 0) /* position offset from end/bottom */
{ {
GList *children = gtk_container_get_children (GTK_CONTAINER (menu)); GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
int length = g_list_length (children); gint length = (gint) g_list_length (children);
g_list_free (children); g_list_free (children);
pos = length + pos; pos = length + pos;
+2 -2
View File
@@ -1364,7 +1364,7 @@ setup_entry_cb (GtkEntry *entry, setting *set)
int size; int size;
int pos; int pos;
unsigned char *p = (unsigned char*)gtk_entry_get_text (entry); unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
int len = strlen (p); size_t len = strlen ((const char *) p);
/* need to truncate? */ /* need to truncate? */
if (len >= set->extra) if (len >= set->extra)
@@ -2180,7 +2180,7 @@ unslash (char *dir)
{ {
if (dir[0]) if (dir[0])
{ {
int len = strlen (dir) - 1; size_t len = strlen (dir) - 1;
#ifdef WIN32 #ifdef WIN32
if (dir[len] == '/' || dir[len] == '\\') if (dir[len] == '/' || dir[len] == '\\')
#else #else
+2 -1
View File
@@ -313,7 +313,8 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
gboolean no_activity) gboolean no_activity)
{ {
int dotime = FALSE; int dotime = FALSE;
int comma, k, i = 0, j = 0, len = strlen (text); int comma, k, i = 0, j = 0;
size_t len = strlen (text);
unsigned char *newtext = g_malloc (len + 1024); unsigned char *newtext = g_malloc (len + 1024);
+11 -4
View File
@@ -26,12 +26,19 @@
#include <windows.h> #include <windows.h>
#include <cstdlib> #include <cstdlib>
#include <climits>
#include "typedef.h" // for ssize_t #include "typedef.h" // for ssize_t
#include <enchant-provider.h> #include <enchant-provider.h>
ENCHANT_PLUGIN_DECLARE ("win8") ENCHANT_PLUGIN_DECLARE ("win8")
static int
size_to_int (size_t value)
{
return value > static_cast<size_t>(INT_MAX) ? INT_MAX : static_cast<int>(value);
}
static char * static char *
utf16_to_utf8 (const wchar_t * const str, bool from_bcp47) utf16_to_utf8 (const wchar_t * const str, bool from_bcp47)
{ {
@@ -136,7 +143,7 @@ static void
win8_dict_add_to_personal (EnchantDict *dict, const char *const word, size_t len) win8_dict_add_to_personal (EnchantDict *dict, const char *const word, size_t len)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
checker->Add (wword); checker->Add (wword);
std::free (wword); std::free (wword);
@@ -146,7 +153,7 @@ static void
win8_dict_add_to_session (EnchantDict *dict, const char *const word, size_t len) win8_dict_add_to_session (EnchantDict *dict, const char *const word, size_t len)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
checker->Ignore (wword); checker->Ignore (wword);
std::free (wword); std::free (wword);
@@ -156,7 +163,7 @@ static int
win8_dict_check (EnchantDict *dict, const char *const word, size_t len) win8_dict_check (EnchantDict *dict, const char *const word, size_t len)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
IEnumSpellingError *errors; IEnumSpellingError *errors;
ISpellingError *error = nullptr; ISpellingError *error = nullptr;
HRESULT hr; HRESULT hr;
@@ -184,7 +191,7 @@ static char **
win8_dict_suggest (EnchantDict *dict, const char *const word, size_t len, size_t *out_n_suggs) win8_dict_suggest (EnchantDict *dict, const char *const word, size_t len, size_t *out_n_suggs)
{ {
auto checker = static_cast<ISpellChecker*>(dict->user_data); auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false); wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
IEnumString *suggestions; IEnumString *suggestions;
HRESULT hr; HRESULT hr;
+2 -2
View File
@@ -30,8 +30,8 @@ PrivilegesRequired=none
ShowComponentSizes=no ShowComponentSizes=no
CreateUninstallRegKey=not IsTaskSelected('portable') CreateUninstallRegKey=not IsTaskSelected('portable')
Uninstallable=not IsTaskSelected('portable') Uninstallable=not IsTaskSelected('portable')
ArchitecturesAllowed=x64 ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64 ArchitecturesInstallIn64BitMode=x64compatible
MinVersion=6.1 MinVersion=6.1
WizardImageFile={#PROJECTDIR}wizardimage.bmp WizardImageFile={#PROJECTDIR}wizardimage.bmp
WizardSmallImageFile={#PROJECTDIR}wizardsmallimage.bmp WizardSmallImageFile={#PROJECTDIR}wizardsmallimage.bmp
+1 -1
View File
@@ -1 +1 @@
2.18.0 2.18.1