Skip to content

Commit

Permalink
Use log_str for message
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Jan 29, 2025
1 parent b638e8f commit c1dfb75
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/mged/primitives/eddsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,17 @@ ecmd_dsp_fname(struct mged_solid_edit *s)
const char *fname;
struct stat stat_buf;
b_off_t need_size;
struct bu_vls message = BU_VLS_INIT_ZERO;
bu_clbk_t f = NULL;
void *d = NULL;

RT_DSP_CK_MAGIC(dsp);

/* Pop-up the Tk file browser */
fname = get_file_name(s, bu_vls_addr(&dsp->dsp_name));
if (! fname) return BRLCAD_OK;

if (stat(fname, &stat_buf)) {
bu_vls_printf(&message, "Cannot get status of file %s\n", fname);
Tcl_SetResult(s->interp, bu_vls_addr(&message), TCL_VOLATILE);
bu_vls_free(&message);
bu_vls_printf(s->log_str, "Cannot get status of file %s\n", fname);
mged_sedit_clbk_get(&f, &d, s, ECMD_PRINT_RESULTS, 0, GED_CLBK_DURING);
if (f)
(*f)(0, NULL, d, NULL);
Expand All @@ -227,9 +224,7 @@ ecmd_dsp_fname(struct mged_solid_edit *s)

need_size = dsp->dsp_xcnt * dsp->dsp_ycnt * 2;
if (stat_buf.st_size < need_size) {
bu_vls_printf(&message, "File (%s) is too small, adjust the file size parameters first", fname);
Tcl_SetResult(s->interp, bu_vls_addr(&message), TCL_VOLATILE);
bu_vls_free(&message);
bu_vls_printf(s->log_str, "File (%s) is too small, adjust the file size parameters first", fname);
mged_sedit_clbk_get(&f, &d, s, ECMD_PRINT_RESULTS, 0, GED_CLBK_DURING);
if (f)
(*f)(0, NULL, d, NULL);
Expand Down

0 comments on commit c1dfb75

Please sign in to comment.