mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix bug in readWString
This commit is contained in:
parent
743631c217
commit
c5370b497b
3 changed files with 10 additions and 4 deletions
|
@ -209,12 +209,16 @@ int main(int argc, char *argv[]) {
|
|||
PathAppend(path, (app_name + "\\").c_str());
|
||||
#else
|
||||
// Mac / Linux
|
||||
const char *path = getenv("HOME");
|
||||
if (!path) {
|
||||
char path[512];
|
||||
const char *the_path = getenv("HOME");
|
||||
if (!the_path) {
|
||||
struct passwd* pwd = getpwuid(getuid());
|
||||
if (pwd)
|
||||
path = pwd->pw_dir;
|
||||
the_path = pwd->pw_dir;
|
||||
}
|
||||
strcpy(path, the_path);
|
||||
if (path[strlen(path)-1] != '/')
|
||||
strcat(path, "/");
|
||||
#endif
|
||||
|
||||
NativeInit(argc, (const char **)argv, path, "/tmp", "BADCOFFEE");
|
||||
|
|
|
@ -18,10 +18,12 @@ class InlineFastList {
|
|||
void Add(T t) {
|
||||
data_[count_++] = t;
|
||||
}
|
||||
|
||||
void RemoveAt(int index) {
|
||||
data_[index] = data_[count_ - 1];
|
||||
count_--;
|
||||
}
|
||||
|
||||
void Remove(T t) { // Requires operator==
|
||||
for (int i = 0; i < count_; i++) {
|
||||
if (data_[i] == t) {
|
||||
|
|
|
@ -239,7 +239,7 @@ static std::string fromUnicode(const uint16_t *src, int len) {
|
|||
std::string str;
|
||||
str.resize(len);
|
||||
for (int i=0; i<len; i++) {
|
||||
str[i] = i > 255 ? ' ' : i;
|
||||
str[i] = src[i] > 255 ? ' ' : src[i];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue