diff --git a/src/chat/chat_core_priv.h b/src/chat/chat_core_priv.h index af6d9f88..1c03a193 100644 --- a/src/chat/chat_core_priv.h +++ b/src/chat/chat_core_priv.h @@ -59,7 +59,7 @@ static inline size_t b64_decode(const char* src, size_t src_len, uint8_t* dst, s if (vi == 4) { dst[out++] = (uint8_t)((vals[0] << 2) | (vals[1] >> 4)); if (out < dst_cap) dst[out++] = (uint8_t)((vals[1] << 4) | (vals[2] >> 2)); - if (out < dst_cap && i + 1 < src_len && src[i + 1] != '=') + if (out < dst_cap) dst[out++] = (uint8_t)((vals[2] << 6) | vals[3]); vi = 0; } diff --git a/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt b/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt index 6e0f86d4..f384b33b 100644 --- a/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt +++ b/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt @@ -449,8 +449,6 @@ private fun formatDuration(ms: Int): String { private fun formatTime(ts: Long): String { if (ts == 0L) return "" - val s = ts / 1_000_000_000 - val h = (s / 3600) % 24 - val m = (s / 60) % 60 - return "%02d:%02d".format(h, m) + val dt = java.time.Instant.ofEpochMilli(ts).atZone(java.time.ZoneId.systemDefault()) + return "%02d:%02d".format(dt.hour, dt.minute) }