ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/AmigaOS/extfs_amiga.cpp
(Generate patch)

Comparing BasiliskII/src/AmigaOS/extfs_amiga.cpp (file contents):
Revision 1.5 by cebix, 1999-12-22T16:16:13Z vs.
Revision 1.6 by cebix, 2000-01-21T13:47:02Z

# Line 84 | Line 84 | struct finf_struct {
84          uint32 type;
85          uint32 creator;
86          uint16 flags;
87 <        uint16 pad0;
87 >        uint8 pad0[22]; // total size: 32 bytes to match the size of FInfo+FXInfo
88   };
89  
90   static void make_helper_path(const char *src, char *dest, const char *add, bool only_dir = false)
# Line 221 | Line 221 | void get_finder_type(const char *path, u
221  
222                  // Read file
223                  finf_struct finf;
224 <                if (read(fd, &finf, sizeof(finf_struct)) == sizeof(finf_struct)) {
224 >                if (read(fd, &finf, sizeof(finf_struct)) >= 8) {
225  
226                          // Type/creator are in Finder info file, return them
227                          type = ntohl(finf.type);
# Line 254 | Line 254 | void set_finder_type(const char *path, u
254                  return;
255  
256          // Read file
257 <        finf_struct finf = {0, 0, DEFAULT_FINDER_FLAGS, 0};
257 >        finf_struct finf;
258 >        finf.flags = DEFAULT_FINDER_FLAGS;
259 >        memset(&finf, 0, sizeof(finf_struct));
260          read(fd, &finf, sizeof(finf_struct));
261  
262          // Set Finder flags
# Line 283 | Line 285 | void get_finder_flags(const char *path,
285  
286          // Read Finder flags
287          finf_struct finf;
288 <        if (read(fd, &finf, sizeof(finf_struct)) == sizeof(finf_struct))
288 >        if (read(fd, &finf, sizeof(finf_struct)) >= 10)
289                  flags = ntohs(finf.flags);
290  
291          // Close file
# Line 298 | Line 300 | void set_finder_flags(const char *path,
300                  return;
301  
302          // Read file
303 <        finf_struct finf = {0, 0, DEFAULT_FINDER_FLAGS, 0};
303 >        finf_struct finf;
304 >        memset(&finf, 0, sizeof(finf_struct));
305 >        finf.flags = DEFAULT_FINDER_FLAGS;
306          read(fd, &finf, sizeof(finf_struct));
307  
308          // Set Finder flags

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines