Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More elegant way of solving #5839 (d_private in sceIoDread) #5871

Merged
merged 3 commits into from
Apr 13, 2014

Conversation

hrydgard
Copy link
Owner

Flag filesystems as being FAT32 and thus providing this extra struct with short filename etc, instead of checking for "ms0:".

Also replace the strncpy with something that won't write a lot more bytes than needed.

We flag filesystems as being FAT32 instead of checking for "ms0:".
@@ -255,6 +255,10 @@ std::string MetaFileSystem::NormalizePrefix(std::string prefix) const {
if (startsWith(prefix, "host"))
prefix = "host0:";

// Should we simply make this case insensitive?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think probably so, but that's probably another matter. I thought we already handled case sensitivity somewhere else but I'm not sure now...

-[Unknown]

static void strcpy_limit(char *dest, const char *src, int count) {
int i;
for (i = 0; i < count; i++) {
if (!src[i]) // Do the check afterwards, so we don't exit before copying the null terminator.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this comment seems misplaced.

Also, I think the for ought to go to count - 1?

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings are hard. Depends on if count is the character count or the size we write to, I suppose the latter so count - 1. That comment was from an earlier edit, fixing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, indeed.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

We may end up wanting to do something similar to this for disc0/umd0 at some point.

-[Unknown]

unknownbrackets added a commit that referenced this pull request Apr 13, 2014
More elegant way of solving #5839 (d_private in sceIoDread)
@unknownbrackets unknownbrackets merged commit 27708d6 into master Apr 13, 2014
@hrydgard hrydgard deleted the sceiodread_ms0check branch April 13, 2014 22:06
@sum2012
Copy link
Collaborator

sum2012 commented Apr 13, 2014

should be More elegant way of solving #5865

@hrydgard
Copy link
Owner Author

Ah right. Too late :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants