diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/newview/llviewermenufile.cpp | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/newview/llviewermenufile.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenufile.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp index d0b8c73..4d46a8f 100644 --- a/linden/indra/newview/llviewermenufile.cpp +++ b/linden/indra/newview/llviewermenufile.cpp | |||
@@ -222,7 +222,7 @@ class LLFileUploadImage : public view_listener_t | |||
222 | { | 222 | { |
223 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 223 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
224 | { | 224 | { |
225 | const char* filename = upload_pick((void *)(S32)LLFilePicker::FFLOAD_IMAGE); | 225 | const char* filename = upload_pick((void *)LLFilePicker::FFLOAD_IMAGE); |
226 | if (filename) | 226 | if (filename) |
227 | { | 227 | { |
228 | LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename); | 228 | LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename); |
@@ -236,7 +236,7 @@ class LLFileUploadSound : public view_listener_t | |||
236 | { | 236 | { |
237 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 237 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
238 | { | 238 | { |
239 | const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_WAV)); | 239 | const char* filename = upload_pick((void*)LLFilePicker::FFLOAD_WAV); |
240 | if (filename) | 240 | if (filename) |
241 | { | 241 | { |
242 | LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); | 242 | LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); |
@@ -250,7 +250,7 @@ class LLFileUploadAnim : public view_listener_t | |||
250 | { | 250 | { |
251 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 251 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
252 | { | 252 | { |
253 | const char* filename = upload_pick((void*)((S32)LLFilePicker::FFLOAD_ANIM)); | 253 | const char* filename = upload_pick((void*)LLFilePicker::FFLOAD_ANIM); |
254 | if (filename) | 254 | if (filename) |
255 | { | 255 | { |
256 | LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); | 256 | LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); |
@@ -691,7 +691,10 @@ void upload_new_resource(const LLString& src_filename, std::string name, | |||
691 | S16 type_num; | 691 | S16 type_num; |
692 | 692 | ||
693 | // read in and throw out most of the header except for the type | 693 | // read in and throw out most of the header except for the type |
694 | fread(buf, header_size, 1, in); | 694 | if (fread(buf, header_size, 1, in) != 1) |
695 | { | ||
696 | llwarns << "Short read" << llendl; | ||
697 | } | ||
695 | memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */ | 698 | memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */ |
696 | asset_type = (LLAssetType::EType)type_num; | 699 | asset_type = (LLAssetType::EType)type_num; |
697 | } | 700 | } |
@@ -702,7 +705,10 @@ void upload_new_resource(const LLString& src_filename, std::string name, | |||
702 | { | 705 | { |
703 | while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ | 706 | while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ |
704 | { | 707 | { |
705 | fwrite(buf, 1, read, out); /* Flawfinder: ignore */ | 708 | if (fwrite(buf, 1, read, out) != read) |
709 | { | ||
710 | llwarns << "Short write" << llendl; | ||
711 | } | ||
706 | } | 712 | } |
707 | fclose(out); | 713 | fclose(out); |
708 | } | 714 | } |