diff options
| author | John Cliff <john.cliff@gmail.com> | 2008-08-20 21:01:27 +0000 |
|---|---|---|
| committer | johncliff <johncliff@users.sourceforge.net> | 2008-08-20 21:01:27 +0000 |
| commit | 62e029584467e0cfc9e7d278732202a7cede9cd5 (patch) | |
| tree | 996467438e67ed2b841ddea4b3860768cfa84611 /src/main.cpp | |
| parent | Make lpe-ruler work for arbitrary paths, not just line segments (diff) | |
| download | inkscape-62e029584467e0cfc9e7d278732202a7cede9cd5.tar.gz inkscape-62e029584467e0cfc9e7d278732202a7cede9cd5.zip | |
Fix to bug with export-width and export-height due to errno not being reset during strtoul.
See jabber logs at 4pm 8/20/08
(bzr r6707)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index f19dac81c..f9904c71c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -434,7 +434,7 @@ static Glib::ustring _win32_getExePath() /** * Set up the PATH and PYTHONPATH environment variables on * win32 - */ + */ static int _win32_set_inkscape_env(const Glib::ustring &exePath) { @@ -477,7 +477,7 @@ static int _win32_set_inkscape_env(const Glib::ustring &exePath) /** * This is the classic main() entry point of the program, though on some * architectures it might be called by something else. - */ + */ int main(int argc, char **argv) { @@ -505,7 +505,7 @@ main(int argc, char **argv) /** * Call bindtextdomain() for various machines's paths - */ + */ #ifdef ENABLE_NLS #ifdef WIN32 Glib::ustring localePath = homedir; @@ -1104,6 +1104,7 @@ sp_do_export_png(SPDocument *doc) unsigned long int height = 0; if (sp_export_width) { + errno=0; width = strtoul(sp_export_width, NULL, 0); if ((width < 1) || (width > PNG_UINT_31_MAX) || (errno == ERANGE) ) { g_warning("Export width %lu out of range (1 - %lu). Nothing exported.", width, (unsigned long int)PNG_UINT_31_MAX); @@ -1113,6 +1114,7 @@ sp_do_export_png(SPDocument *doc) } if (sp_export_height) { + errno=0; height = strtoul(sp_export_height, NULL, 0); if ((height < 1) || (height > PNG_UINT_31_MAX)) { g_warning("Export height %lu out of range (1 - %lu). Nothing exported.", height, (unsigned long int)PNG_UINT_31_MAX); |
