Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.1
openmotif22-libs
openmotif-uil.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openmotif-uil.diff of Package openmotif22-libs
--- clients/uil/UilDiags.c +++ clients/uil/UilDiags.c @@ -207,9 +207,9 @@ va_list ap; /* ptr to variable length parameter */ int severity; /* severity of message */ int message_number; /* message number */ - char msg_buffer[132]; /* buffer to construct message */ + char *msg_buffer = 0; /* buffer to construct message */ char ptr_buffer[buf_size]; /* buffer to construct pointer */ - char loc_buffer[132]; /* buffer to construct location */ + char *loc_buffer = 0; /* buffer to construct location */ char src_buffer[buf_size]; /* buffer to hold source line */ /* @@ -293,19 +293,18 @@ va_start(ap, l_start_column); #ifndef NO_MESSAGE_CATALOG - vsprintf( msg_buffer, + vasprintf(&msg_buffer, catgets(uil_catd, UIL_SET1, msg_cat_table[ message_number ], diag_rz_msg_table[ message_number ].ac_text), ap ); #else - vsprintf( msg_buffer, + vasprintf(&msg_buffer, diag_rz_msg_table[ message_number ].ac_text, ap ); #endif va_end(ap); src_buffer[ 0 ] = 0; - loc_buffer[ 0 ] = 0; ptr_buffer[ 0 ] = 0; if (az_src_rec != diag_k_no_source) @@ -317,13 +316,13 @@ */ #ifndef NO_MESSAGE_CATALOG - sprintf( loc_buffer, + asprintf(&loc_buffer, catgets(uil_catd, UIL_SET_MISC, UIL_MISC_0, "\t\t line: %d file: %s"), az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); #else - sprintf( loc_buffer, + asprintf(&loc_buffer, "\t\t line: %d file: %s", az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); @@ -371,7 +370,7 @@ if (l_start_column != diag_k_no_column) #ifndef NO_MESSAGE_CATALOG - sprintf(loc_buffer, + asprintf(&loc_buffer, catgets(uil_catd, UIL_SET_MISC, UIL_MISC_1, "\t\t line: %d position: %d file: %s"), @@ -379,7 +378,7 @@ l_start_column + 1, src_get_file_name( az_src_rec ) ); #else - sprintf(loc_buffer, + asprintf(&loc_buffer, "\t\t line: %d position: %d file: %s", az_src_rec->w_line_number, l_start_column + 1, @@ -387,13 +386,13 @@ #endif else #ifndef NO_MESSAGE_CATALOG - sprintf( loc_buffer, catgets(uil_catd, UIL_SET_MISC, + asprintf(&loc_buffer, catgets(uil_catd, UIL_SET_MISC, UIL_MISC_0, "\t\t line: %d file: %s"), az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); #else - sprintf( loc_buffer, + asprintf(&loc_buffer, "\t\t line: %d file: %s", az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); @@ -406,7 +405,8 @@ */ write_msg_to_standard_error - ( message_number, src_buffer, ptr_buffer, msg_buffer, loc_buffer ); + ( message_number, src_buffer, ptr_buffer, msg_buffer, + loc_buffer ? loc_buffer : ""); /* ** if we have a listing, place message in the source structure @@ -428,6 +428,8 @@ uil_exit( uil_k_severe_status ); } + free (loc_buffer); + free (msg_buffer); } /* --- clients/uil/UilIODef.h +++ clients/uil/UilIODef.h @@ -75,7 +75,7 @@ char *c_buffer; boolean v_position_before_get; z_key last_key; - char expanded_name[ 256 ]; + char *expanded_name; } uil_fcb_type; #endif /* UilIODef_h */ --- clients/uil/UilSrcSrc.c +++ clients/uil/UilSrcSrc.c @@ -271,6 +271,7 @@ diag_k_no_source, diag_k_no_column, src_az_source_file_table[i]->expanded_name); } + _free_memory (src_az_source_file_table[i]->expanded_name); _free_memory ((char*)src_az_source_file_table [i]); src_az_source_file_table[i] = NULL; } @@ -626,12 +627,13 @@ static unsigned short main_dir_len = 0; boolean main_file; int i; /* loop index through include files */ - char buffer[256]; + char *buffer; /* place the file name in the expanded_name buffer */ - strcpy(buffer, c_file_name); + buffer = _get_memory (strlen (c_file_name) + 1); + strcpy (buffer, c_file_name); /* Determine if this is the main file or an include file. */ @@ -673,11 +675,10 @@ } if (!specific_directory) { + buffer = XtRealloc (buffer, main_dir_len + strlen (c_file_name) + 1); _move (buffer, main_fcb -> expanded_name, main_dir_len); _move (& buffer [main_dir_len], c_file_name, strlen (c_file_name) + 1); /* + NULL */ - } else { - strcpy (buffer, c_file_name); } /* Open the include file. */ @@ -700,6 +701,7 @@ if (inc_dir_len == 0) { search_user_include = False; } + buffer = XtRealloc (buffer, inc_dir_len + strlen (c_file_name) + 1); _move (buffer, Uil_cmd_z_command.ac_include_dir[i], inc_dir_len); /* Add '/' if not specified at end of directory */ @@ -723,6 +725,7 @@ /* Look in the default include directory. */ if (search_user_include) { + buffer = XtRealloc (buffer, sizeof c_include_dir - 1 + strlen (c_file_name) + 1); _move(buffer, c_include_dir, sizeof c_include_dir - 1); /* no NULL */ _move(&buffer[sizeof c_include_dir - 1], c_file_name, strlen (c_file_name) + 1); /* + NULL */ @@ -736,14 +739,16 @@ /* check the open status. */ - if (az_fcb->az_file_ptr == NULL) + if (az_fcb->az_file_ptr == NULL) { + _free_memory (buffer); return src_k_open_error; + } /* open succeeded - place buffer address in fcb */ az_fcb->c_buffer = az_source_buffer->c_text; az_fcb->c_buffer[ src_k_max_source_line_length ] = 0; - strcpy(az_fcb->expanded_name, buffer); + az_fcb->expanded_name = buffer; return src_k_open_normal; } --- tools/wml/Uil.y +++ tools/wml/Uil.y @@ -559,7 +559,7 @@ object_specification : CLASS_NAME - { sar_set_object_class (&$1); } + { sar_set_object_class (&$1); $$ = gz_yynullval;} opt_create_proc_ref opt_variant object_spec
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor