prefer ansi c rand() to posix random(), doh

This commit is contained in:
nick black 2021-07-22 20:55:12 -04:00
parent 3f8e21fc61
commit a26b28e10f
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 5 additions and 1 deletions

View File

@ -210,7 +210,7 @@ int sprite_clear_all(const tinfo* t, FILE* fp){
}
int sprite_init(const tinfo* t, int fd){
sprixelid_nonce = random() % 0xffffffu;
sprixelid_nonce = rand() % 0xffffffu;
if(t->pixel_init == NULL){
return 0;
}

View File

@ -1,7 +1,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <ncurses.h> // needed for some definitions, see terminfo(3ncurses)
#ifdef __linux__
#include <sys/utsname.h>
#endif
#include "internal.h"
#include "input.h"
#include "linux.h"
@ -579,6 +581,7 @@ apply_term_heuristics(tinfo* ti, const char* termname, int fd,
ti->caps.quadrants = true;
ti->caps.rgb = true;
setup_iterm_bitmaps(ti, fd);
#ifdef __linux__
}else if(qterm == TERMINAL_LINUX){
struct utsname un;
if(uname(&un) == 0){
@ -591,6 +594,7 @@ apply_term_heuristics(tinfo* ti, const char* termname, int fd,
termname = "Linux console";
}
ti->caps.braille = false; // no caps.braille, no caps.sextants in linux console
#endif
}else if(qterm == TERMINAL_TERMINOLOGY){
termname = "Terminology";
ti->caps.rgb = false; // as of at least 1.9.0