diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-05-05 22:46:40 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-05-05 22:50:25 +0100 |
commit | 35bc2ccbb89a6b499e0e3b6f7095afea214f0c59 (patch) | |
tree | cd494ae1e33ab55d0e644d11eb973ddde4decbb6 /frontends/amiga/file.c | |
parent | f966580d22d47ab97bceb2f067fc2b9402af01b7 (diff) | |
download | netsurf-35bc2ccbb89a6b499e0e3b6f7095afea214f0c59.tar.gz netsurf-35bc2ccbb89a6b499e0e3b6f7095afea214f0c59.tar.bz2 |
change content get_source_data interfaces to return uint8_t and size_t
previously these interfaces returned char * and unsigned int which was
undesirable.
Diffstat (limited to 'frontends/amiga/file.c')
-rw-r--r-- | frontends/amiga/file.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/frontends/amiga/file.c b/frontends/amiga/file.c index 0fd43781d..845491c78 100644 --- a/frontends/amiga/file.c +++ b/frontends/amiga/file.c @@ -146,8 +146,9 @@ void ami_file_save(int type, char *fname, struct Window *win, struct browser_window *bw) { BPTR lock, fh; - const char *source_data; - ULONG source_size; + const uint8_t *source_data; + char *selection; + size_t source_size; struct bitmap *bm; ami_update_pointer(win, GUI_POINTER_WAIT); @@ -155,7 +156,8 @@ void ami_file_save(int type, char *fname, struct Window *win, if(ami_download_check_overwrite(fname, win, 0)) { switch(type) { case AMINS_SAVE_SOURCE: - if((source_data = content_get_source_data(object, &source_size))) { + source_data = content_get_source_data(object, &source_size); + if(source_data) { BPTR fh; if((fh = FOpen(fname, MODE_NEWFILE,0))) { FWrite(fh, source_data, 1, source_size); @@ -197,12 +199,17 @@ void ami_file_save(int type, char *fname, struct Window *win, break; case AMINS_SAVE_SELECTION: - if((source_data = browser_window_get_selection(bw))) { - if((fh = FOpen(fname, MODE_NEWFILE,0))) { - FWrite(fh, source_data, 1, strlen(source_data)); + selection = browser_window_get_selection(bw); + if(selection) { + fh = FOpen(fname, MODE_NEWFILE,0); + if (fh) { + FWrite(fh, + selection, + 1, + strlen(selection)); FClose(fh); } - free((void *)source_data); + free(selection); } break; } |