Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/OBSApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ string CurrentDateTimeString()
struct tm tstruct;
char buf[80];
tstruct = *localtime(&now);
strftime(buf, sizeof(buf), "%Y-%m-%d, %X", &tstruct);
strftime(buf, sizeof(buf), "%Y-%m-%d, %H:%M:%S", &tstruct);
return buf;
}

Expand Down
6 changes: 3 additions & 3 deletions frontend/OBSApp_Themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static vector<OBSThemeVariable> ParseThemeVariables(const char *themeData)

/* Look for a suffix and mark variable as size if it exists */
while (ch < end) {
if (!isdigit(*ch) && !isspace(*ch) && *ch != '.') {
if (!isdigit((unsigned char)*ch) && !isspace((unsigned char)*ch) && *ch != '.') {
var.suffix = QString::fromUtf8(ch, end - ch);
var.type = OBSThemeVariable::Size;
break;
Expand Down Expand Up @@ -526,14 +526,14 @@ static OBSThemeVariable ParseMathVariable(const QHash<QString, OBSThemeVariable>
const QByteArray utf8 = value.toUtf8();
const char *data = utf8.constData();

if (isdigit(*data)) {
if (isdigit((unsigned char)*data)) {
double f = os_strtod(data);
var.type = OBSThemeVariable::Number;
var.value = f;

const char *dataEnd = data + utf8.size();
while (data < dataEnd) {
if (*data && !isdigit(*data) && *data != '.') {
if (*data && !isdigit((unsigned char)*data) && *data != '.') {
var.suffix = QString::fromUtf8(data, dataEnd - data);
var.type = OBSThemeVariable::Size;
break;
Expand Down
5 changes: 5 additions & 0 deletions frontend/cmake/windows/obs.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
</requestedPrivileges>
</security>
</trustInfo>
<application>
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and Windows 11 -->
Expand Down
2 changes: 1 addition & 1 deletion libobs/obs-win-crash-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static inline void write_header(struct exception_handler_data *data)
time_t now = time(0);
struct tm ts;
ts = *localtime(&now);
strftime(date_time, sizeof(date_time), "%Y-%m-%d, %X", &ts);
strftime(date_time, sizeof(date_time), "%Y-%m-%d, %H:%M:%S", &ts);

const char *obs_bitness;
if (sizeof(void *) == 8)
Expand Down
5 changes: 4 additions & 1 deletion libobs/obs.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,11 @@ EXPORT const char *obs_get_version_string(void);
* and safely copies argv/argc from main(). Subsequent calls do nothing.
*
* @param argc The count of command line arguments, from main()
* @param argv An array of command line arguments, copied from main() and ends
* @param argv An array of command line arguments in UTF-8, copied from main() and ends
* with NULL.
*
* On Windows this requires that active code page is UTF-8.
* For example as a declaration in obs.manifest.
*/
EXPORT void obs_set_cmdline_args(int argc, const char *const *argv);

Expand Down
2 changes: 1 addition & 1 deletion libobs/util/cf-lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static inline void cf_convert_from_escape_literal(char **p_dst, const char **p_s

/* oct */
default:
if (isdigit(*src)) {
if (isdigit((unsigned char)*src)) {
*(dst++) = (char)strtoul(src, NULL, 8);
src += 3;
}
Expand Down
12 changes: 6 additions & 6 deletions libobs/util/dstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ int astrcmpi(const char *str1, const char *str2)
str2 = astrblank;

do {
char ch1 = (char)toupper(*str1);
char ch2 = (char)toupper(*str2);
unsigned char ch1 = (unsigned char)toupper((unsigned char)*str1);
unsigned char ch2 = (unsigned char)toupper((unsigned char)*str2);

if (ch1 < ch2)
return -1;
Expand Down Expand Up @@ -85,8 +85,8 @@ int astrcmp_n(const char *str1, const char *str2, size_t n)
str2 = astrblank;

do {
char ch1 = *str1;
char ch2 = *str2;
unsigned char ch1 = (unsigned char)*str1;
unsigned char ch2 = (unsigned char)*str2;

if (ch1 < ch2)
return -1;
Expand Down Expand Up @@ -129,8 +129,8 @@ int astrcmpi_n(const char *str1, const char *str2, size_t n)
str2 = astrblank;

do {
char ch1 = (char)toupper(*str1);
char ch2 = (char)toupper(*str2);
unsigned char ch1 = (unsigned char)toupper((unsigned char)*str1);
unsigned char ch2 = (unsigned char)toupper((unsigned char)*str2);

if (ch1 < ch2)
return -1;
Expand Down
20 changes: 12 additions & 8 deletions libobs/util/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ int strref_cmp(const struct strref *str1, const char *str2)
str2 = astrblank;

do {
char ch1, ch2;
unsigned char ch1;
unsigned char ch2;

ch1 = (i < str1->len) ? str1->array[i] : 0;
ch2 = *str2;
Expand All @@ -53,10 +54,11 @@ int strref_cmpi(const struct strref *str1, const char *str2)
str2 = astrblank;

do {
char ch1, ch2;
unsigned char ch1;
unsigned char ch2;

ch1 = (i < str1->len) ? (char)toupper(str1->array[i]) : 0;
ch2 = (char)toupper(*str2);
ch1 = (i < str1->len) ? (unsigned char)toupper((unsigned char)str1->array[i]) : 0;
ch2 = (unsigned char)toupper((unsigned char)*str2);

if (ch1 < ch2)
return -1;
Expand All @@ -77,7 +79,8 @@ int strref_cmp_strref(const struct strref *str1, const struct strref *str2)
return -1;

do {
char ch1, ch2;
unsigned char ch1;
unsigned char ch2;

ch1 = (i < str1->len) ? str1->array[i] : 0;
ch2 = (i < str2->len) ? str2->array[i] : 0;
Expand All @@ -103,10 +106,11 @@ int strref_cmpi_strref(const struct strref *str1, const struct strref *str2)
return -1;

do {
char ch1, ch2;
unsigned char ch1;
unsigned char ch2;

ch1 = (i < str1->len) ? (char)toupper(str1->array[i]) : 0;
ch2 = (i < str2->len) ? (char)toupper(str2->array[i]) : 0;
ch1 = (i < str1->len) ? (unsigned char)toupper((unsigned char)str1->array[i]) : 0;
ch2 = (i < str2->len) ? (unsigned char)toupper((unsigned char)str2->array[i]) : 0;

if (ch1 < ch2)
return -1;
Expand Down
4 changes: 2 additions & 2 deletions plugins/text-freetype2/find-font.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ static inline size_t get_rating(struct font_path_info *info, struct dstr *cmp)
size_t num = 0;

do {
char ch1 = (char)toupper(*src);
char ch2 = (char)toupper(*dst);
unsigned char ch1 = (unsigned char)toupper((unsigned char)*src);
unsigned char ch2 = (unsigned char)toupper((unsigned char)*dst);

if (ch1 != ch2)
break;
Expand Down