Fixed some portability issues with wofi

This commit is contained in:
Scoopta 2019-11-03 20:20:00 -08:00
parent ea7893eb12
commit 97dd534c97
2 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ static void load_css() {
const char* color = node->line; const char* color = node->line;
const char* wofi_color = "--wofi-color"; const char* wofi_color = "--wofi-color";
char count_str[3]; char count_str[3];
snprintf(count_str, 3, "%lu", count--); snprintf(count_str, 3, "%zu", count--);
char* needle = utils_concat(2, wofi_color, count_str); char* needle = utils_concat(2, wofi_color, count_str);
size_t color_len = strlen(color); size_t color_len = strlen(color);
size_t needle_len = strlen(needle); size_t needle_len = strlen(needle);
@ -300,7 +300,7 @@ int main(int argc, char** argv) {
char* cache_file = NULL; char* cache_file = NULL;
char* terminal = NULL; char* terminal = NULL;
char* password_char = "false"; char* password_char = "false";
char opt; int opt;
while((opt = getopt_long(argc, argv, "hfc:s:C:dS:W:H:p:x:y:nimk:t:P::", opts, NULL)) != -1) { while((opt = getopt_long(argc, argv, "hfc:s:C:dS:W:H:p:x:y:nimk:t:P::", opts, NULL)) != -1) {
switch(opt) { switch(opt) {
case 'h': case 'h':

View File

@ -250,7 +250,7 @@ static void execute_action(char* mode, const gchar* cmd) {
if(strstr(line, cmd) != NULL) { if(strstr(line, cmd) != NULL) {
uint64_t count = strtol(line, NULL, 10) + 1; uint64_t count = strtol(line, NULL, 10) + 1;
char num[6]; char num[6];
snprintf(num, 5, "%lu", count); snprintf(num, 5, "%" PRIu64, count);
node->line = utils_concat(4, num, " ", cmd, "\n"); node->line = utils_concat(4, num, " ", cmd, "\n");
inc_count = true; inc_count = true;
} else { } else {