From 539989469c23a21f5cfa847dbb26a8a960c34bf7 Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Wed, 1 Mar 2023 14:45:23 -0600 Subject: [PATCH] Fix sprintf problem in SIM_sun. #1464 --- trick_sims/SIM_sun/RUN_test/input.py | 5 ----- trick_sims/SIM_sun/models/Sun/src/sun_pred_fast_display.c | 4 ++-- trick_sims/SIM_sun/models/Sun/src/sun_pred_slow_display.c | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/trick_sims/SIM_sun/RUN_test/input.py b/trick_sims/SIM_sun/RUN_test/input.py index 5a6f08df..e96e132e 100644 --- a/trick_sims/SIM_sun/RUN_test/input.py +++ b/trick_sims/SIM_sun/RUN_test/input.py @@ -31,11 +31,6 @@ if STRIPCHART: sun_predictor.sun.observer_latitude = trick.sim_services.attach_units("degree" , 29.55298) sun_predictor.sun.observer_longitude = trick.sim_services.attach_units("degree" , 95.09379) -# Mom's House -#sun_predictor.sun.observer_latitude = trick.sim_services.attach_units("d" , 38.842677) -#sun_predictor.sun.observer_longitude = trick.sim_services.attach_units("d" , 83.19773) - - """ ======================================== """ """ TIME ZONE """ """ Pick your time zone by uncommenting the """ diff --git a/trick_sims/SIM_sun/models/Sun/src/sun_pred_fast_display.c b/trick_sims/SIM_sun/models/Sun/src/sun_pred_fast_display.c index fa9a7cbb..d3f95761 100644 --- a/trick_sims/SIM_sun/models/Sun/src/sun_pred_fast_display.c +++ b/trick_sims/SIM_sun/models/Sun/src/sun_pred_fast_display.c @@ -63,10 +63,10 @@ int sun_pred_fast_display( snprintf(tmp_s, sizeof(tmp_s), " AZIMUTH %.3f%d", S->solar_azimuth, DEGREE_SIGN); } strcat(message,tmp_s); - snprintf(tmp_s," sizeof(tmp_s), %ls %.3f%d",S->label_Elevation, S->solar_elevation, DEGREE_SIGN); + snprintf(tmp_s, sizeof(tmp_s), " %ls %.3f%d",S->label_Elevation, S->solar_elevation, DEGREE_SIGN); strcat(message,tmp_s); - send_hs(stdout,"%s\n",message); + fprintf(stdout,"%s\n",message); return 0; } diff --git a/trick_sims/SIM_sun/models/Sun/src/sun_pred_slow_display.c b/trick_sims/SIM_sun/models/Sun/src/sun_pred_slow_display.c index c95d6af2..a6116df4 100644 --- a/trick_sims/SIM_sun/models/Sun/src/sun_pred_slow_display.c +++ b/trick_sims/SIM_sun/models/Sun/src/sun_pred_slow_display.c @@ -65,7 +65,7 @@ int sun_pred_slow_display( strcat(message,tmp_s); snprintf(tmp_s, sizeof(tmp_s), " %lc %5.2f%lc",GREEK_SMALL_LETTER_DELTA, S->declination, DEGREE_SIGN); strcat(message,tmp_s); - send_hs(stdout,"%s\n",message); + fprintf(stdout,"%s\n",message); return 0 ; }