Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 114234 | Differences between
and this patch

Collapse All | Expand All

(-)openMotif-2.2.3/lib/Mrm/Mrmhier.c.UIL (-2 / +4 lines)
Lines 712-718 Link Here
712
   *  Local variables
712
   *  Local variables
713
   */
713
   */
714
  Cardinal		result;		/* function results */
714
  Cardinal		result;		/* function results */
715
  char			dummy[300];	/* file name (unused) */
715
  char			*dummy;		/* file name (unused) */
716
  char			err_stg[300];
716
  char			err_stg[300];
717
717
718
  /*
718
  /*
Lines 764-774 Link Here
764
764
765
  if (resolvedname == 0)
765
  if (resolvedname == 0)
766
    {
766
    {
767
      sprintf (err_stg, _MrmMMsg_0031, name) ;
767
      snprintf (err_stg, 300, _MrmMMsg_0031, name) ;
768
      return Urm__UT_Error ("I18NOpenFile", err_stg, NULL, NULL, MrmNOT_FOUND);
768
      return Urm__UT_Error ("I18NOpenFile", err_stg, NULL, NULL, MrmNOT_FOUND);
769
    }
769
    }
770
770
771
  dummy = XtMalloc(strlen(resolvedname)+1);
771
  result = UrmIdbOpenFileRead (resolvedname, os_ext, file_id_return, dummy) ;
772
  result = UrmIdbOpenFileRead (resolvedname, os_ext, file_id_return, dummy) ;
773
  XtFree(dummy);
772
  switch ( result )
774
  switch ( result )
773
    {
775
    {
774
    case MrmSUCCESS:
776
    case MrmSUCCESS:
(-)openMotif-2.2.3/clients/uil/UilIODef.h.UIL (-1 / +6 lines)
Lines 69-81 Link Here
69
#define NULL 0L
69
#define NULL 0L
70
#endif
70
#endif
71
71
72
#include <X11/Xos.h>
73
#ifndef PATH_MAX
74
#  define PATH_MAX 256
75
#endif
76
72
typedef struct  
77
typedef struct  
73
{
78
{
74
    FILE	*az_file_ptr;
79
    FILE	*az_file_ptr;
75
    char	*c_buffer;
80
    char	*c_buffer;
76
    boolean	v_position_before_get;
81
    boolean	v_position_before_get;
77
    z_key	last_key;
82
    z_key	last_key;
78
    char	expanded_name[ 256 ];
83
    char	expanded_name[ PATH_MAX ];
79
} uil_fcb_type;
84
} uil_fcb_type;
80
85
81
#endif /* UilIODef_h */
86
#endif /* UilIODef_h */
(-)openMotif-2.2.3/clients/uil/UilLstLst.c.UIL (-3 / +14 lines)
Lines 164-170 Link Here
164
    lst_l_page_no = 0;
164
    lst_l_page_no = 0;
165
    lst_v_listing_open = TRUE;
165
    lst_v_listing_open = TRUE;
166
166
167
    sprintf(lst_c_title1, 
167
    snprintf(lst_c_title1, 132,
168
	    "%s %s \t%s\t\t Page ",
168
	    "%s %s \t%s\t\t Page ",
169
	    _host_compiler, _compiler_version,
169
	    _host_compiler, _compiler_version,
170
	    current_time(&ctime_buf));
170
	    current_time(&ctime_buf));
Lines 270-275 Link Here
270
{
270
{
271
    /* place the file name in the expanded_name buffer */
271
    /* place the file name in the expanded_name buffer */
272
272
273
    if (strlen(Uil_cmd_z_command.ac_listing_file) >= PATH_MAX)
274
    {
275
      char *p;
276
      int len=0;
277
      if((p = rindex(Uil_cmd_z_command.ac_listing_file, '/')) != NULL)
278
        len = strlen(++p);
279
      if(p == NULL || len >= PATH_MAX)
280
        p = "<unknown>";
281
      strcpy(az_fcb->expanded_name, p);
282
      return src_k_open_error;
283
    }
273
    strcpy(az_fcb->expanded_name, Uil_cmd_z_command.ac_listing_file);
284
    strcpy(az_fcb->expanded_name, Uil_cmd_z_command.ac_listing_file);
274
285
275
    /* open the file */
286
    /* open the file */
Lines 529-535 Link Here
529
	char		buffer [132];
540
	char		buffer [132];
530
541
531
	az_fcb = src_az_source_file_table [i];
542
	az_fcb = src_az_source_file_table [i];
532
	sprintf (buffer,
543
	snprintf (buffer, 132,
533
		 "     File (%d)   %s",
544
		 "     File (%d)   %s",
534
		 i, az_fcb->expanded_name );
545
		 i, az_fcb->expanded_name );
535
	lst_output_line( buffer, FALSE );
546
	lst_output_line( buffer, FALSE );
Lines 598-604 Link Here
598
	}
609
	}
599
610
600
611
601
	sprintf(buffer, "%s (%d) %s", 
612
	snprintf(buffer, 132, "%s (%d) %s", 
602
		diag_get_message_abbrev( az_msg->l_message_number ),
613
		diag_get_message_abbrev( az_msg->l_message_number ),
603
		msg_no, 
614
		msg_no, 
604
		az_msg->c_text);
615
		az_msg->c_text);
(-)openMotif-2.2.3/clients/uil/UilP2Out.c.UIL (-11 / +16 lines)
Lines 189-195 Link Here
189
    int				topmost_index;
189
    int				topmost_index;
190
    struct
190
    struct
191
    {   MrmOsOpenParam	os_param;
191
    {   MrmOsOpenParam	os_param;
192
	char		result_file[256];
192
	char		result_file[PATH_MAX];
193
    } uid_fcb;
193
    } uid_fcb;
194
194
195
195
Lines 234-248 Link Here
234
    if (sym_az_module_entry->az_version != NULL)
234
    if (sym_az_module_entry->az_version != NULL)
235
	module_version = sym_az_module_entry->az_version->value.c_value;
235
	module_version = sym_az_module_entry->az_version->value.c_value;
236
236
237
    urm_status = UrmIdbOpenFileWrite
237
    if (strlen(Uil_cmd_z_command.ac_resource_file) < PATH_MAX)
238
		  ( Uil_cmd_z_command.ac_resource_file,
238
    {
239
		    & uid_fcb.os_param,
239
        urm_status = UrmIdbOpenFileWrite
240
		    _host_compiler,
240
		      ( Uil_cmd_z_command.ac_resource_file,
241
		    _compiler_version,
241
		        & uid_fcb.os_param,
242
		    module_name,
242
		        _host_compiler,
243
		    module_version,
243
		        _compiler_version,
244
		    &out_az_idbfile_id,
244
		        module_name,
245
		    uid_fcb.result_file );
245
		        module_version,
246
		        &out_az_idbfile_id,
247
		        uid_fcb.result_file );
248
    } else {
249
        urm_status = MrmFAILURE;
250
    }
246
251
247
    if (urm_status != MrmSUCCESS)
252
    if (urm_status != MrmSUCCESS)
248
    {
253
    {
Lines 2961-2967 Link Here
2961
{
2966
{
2962
    char    buffer[132];
2967
    char    buffer[132];
2963
2968
2964
    sprintf(buffer, "while %s encountered %s", 
2969
    snprintf(buffer, 132, "while %s encountered %s", 
2965
	    problem, 
2970
	    problem, 
2966
	    Urm__UT_LatestErrorMessage());
2971
	    Urm__UT_LatestErrorMessage());
2967
2972
(-)openMotif-2.2.3/clients/uil/UilSrcSrc.c.UIL (-6 / +20 lines)
Lines 626-636 Link Here
626
    static unsigned short	main_dir_len = 0;
626
    static unsigned short	main_dir_len = 0;
627
    boolean			main_file;
627
    boolean			main_file;
628
    int				i;  /* loop index through include files */
628
    int				i;  /* loop index through include files */
629
    char			buffer[256];
629
    char			buffer[PATH_MAX];
630
    int c_file_name_len;
630
631
632
    az_fcb->az_file_ptr = NULL;
633
    c_file_name_len = strlen(c_file_name);
631
634
632
    /* place the file name in the expanded_name buffer */
635
    /* place the file name in the expanded_name buffer */
633
636
    if(c_file_name_len >= PATH_MAX)
637
      return src_k_open_error;
634
    strcpy(buffer, c_file_name);
638
    strcpy(buffer, c_file_name);
635
639
636
/*    Determine if this is the main file or an include file.  */
640
/*    Determine if this is the main file or an include file.  */
Lines 644-650 Link Here
644
648
645
/*    Save the directory info for the main file.    */
649
/*    Save the directory info for the main file.    */
646
650
647
	for (len = strlen (c_file_name),
651
	for (len = c_file_name_len,
648
	     ptr = & c_file_name [len - 1];
652
	     ptr = & c_file_name [len - 1];
649
	     len > 0; len--, ptr--) {
653
	     len > 0; len--, ptr--) {
650
	    if ((* ptr) == '/') {
654
	    if ((* ptr) == '/') {
Lines 673-681 Link Here
673
	    }
677
	    }
674
678
675
	if (!specific_directory) {
679
	if (!specific_directory) {
680
	    if (main_dir_len + c_file_name_len >= PATH_MAX)
681
	      goto open_label;
676
	    _move (buffer, main_fcb -> expanded_name, main_dir_len);
682
	    _move (buffer, main_fcb -> expanded_name, main_dir_len);
677
	    _move (& buffer [main_dir_len],
683
	    _move (& buffer [main_dir_len],
678
		   c_file_name, strlen (c_file_name) + 1);  /* + NULL */
684
		   c_file_name, c_file_name_len + 1);  /* + NULL */
679
	} else {
685
	} else {
680
	    strcpy (buffer, c_file_name);
686
	    strcpy (buffer, c_file_name);
681
	}
687
	}
Lines 695-710 Link Here
695
701
696
	for (i = 0; i < Uil_cmd_z_command.include_dir_count; i++) {	     
702
	for (i = 0; i < Uil_cmd_z_command.include_dir_count; i++) {	     
697
	    int		inc_dir_len;
703
	    int		inc_dir_len;
704
	    int		need_slash=0;
698
705
699
	    inc_dir_len = strlen (Uil_cmd_z_command.ac_include_dir[i]);
706
	    inc_dir_len = strlen (Uil_cmd_z_command.ac_include_dir[i]);
700
	    if (inc_dir_len == 0) {
707
	    if (inc_dir_len == 0) {
701
		search_user_include = False;
708
		search_user_include = False;
702
		}
709
		}
710
	    if (Uil_cmd_z_command.ac_include_dir[i][inc_dir_len - 1] != '/')
711
		need_slash=1;
712
	    if (inc_dir_len + need_slash + c_file_name_len >= PATH_MAX)
713
		goto open_label;
714
703
	    _move (buffer, Uil_cmd_z_command.ac_include_dir[i], inc_dir_len);
715
	    _move (buffer, Uil_cmd_z_command.ac_include_dir[i], inc_dir_len);
704
716
705
	/*  Add '/' if not specified at end of directory  */
717
	/*  Add '/' if not specified at end of directory  */
706
718
707
	    if (Uil_cmd_z_command.ac_include_dir[i][inc_dir_len - 1] != '/') {
719
	    if (need_slash) {
708
		buffer [inc_dir_len] = '/';
720
		buffer [inc_dir_len] = '/';
709
		inc_dir_len++;
721
		inc_dir_len++;
710
	    };
722
	    };
Lines 723-731 Link Here
723
735
724
/*    Look in the default include directory.    */
736
/*    Look in the default include directory.    */
725
	if (search_user_include) {
737
	if (search_user_include) {
738
	    if (sizeof(c_include_dir)-1 + c_file_name_len >= PATH_MAX)
739
	      goto open_label;
726
	  _move(buffer, c_include_dir, sizeof c_include_dir - 1); /* no NULL */
740
	  _move(buffer, c_include_dir, sizeof c_include_dir - 1); /* no NULL */
727
	  _move(&buffer[sizeof c_include_dir - 1], 
741
	  _move(&buffer[sizeof c_include_dir - 1], 
728
		c_file_name, strlen (c_file_name) + 1);  /* + NULL */
742
		c_file_name, c_file_name_len + 1);  /* + NULL */
729
743
730
/*    Open the include file.    */
744
/*    Open the include file.    */
731
	  az_fcb->az_file_ptr = fopen (buffer, "r");
745
	  az_fcb->az_file_ptr = fopen (buffer, "r");
(-)openMotif-2.2.3/clients/uil/UilSarMod.c.UIL (-2 / +2 lines)
Lines 379-385 Link Here
379
    */
379
    */
380
380
381
    if (Uil_cmd_z_command.v_listing_file)
381
    if (Uil_cmd_z_command.v_listing_file)
382
	sprintf(Uil_lst_c_title2, 
382
	snprintf(Uil_lst_c_title2, 132, 
383
		"Module: %s", 
383
		"Module: %s", 
384
		name_entry->c_text );
384
		name_entry->c_text );
385
385
Lines 479-485 Link Here
479
    */
479
    */
480
480
481
    if (Uil_cmd_z_command.v_listing_file)
481
    if (Uil_cmd_z_command.v_listing_file)
482
	sprintf(Uil_lst_c_title2, 
482
	snprintf(Uil_lst_c_title2, 132, 
483
		"Module: %s \t Version: %s", 
483
		"Module: %s \t Version: %s", 
484
		sym_az_module_entry->obj_header.az_name->c_text,
484
		sym_az_module_entry->obj_header.az_name->c_text,
485
		value_entry->value.c_value );
485
		value_entry->value.c_value );
(-)openMotif-2.2.3/clients/uil/UilDiags.c.UIL (-8 / +8 lines)
Lines 293-304 Link Here
293
    va_start(ap, l_start_column);
293
    va_start(ap, l_start_column);
294
294
295
#ifndef NO_MESSAGE_CATALOG
295
#ifndef NO_MESSAGE_CATALOG
296
    vsprintf( msg_buffer, 
296
    vsnprintf( msg_buffer, 132, 
297
	      catgets(uil_catd, UIL_SET1, msg_cat_table[ message_number ],
297
	      catgets(uil_catd, UIL_SET1, msg_cat_table[ message_number ],
298
		      diag_rz_msg_table[ message_number ].ac_text), 
298
		      diag_rz_msg_table[ message_number ].ac_text), 
299
	     ap );
299
	     ap );
300
#else
300
#else
301
    vsprintf( msg_buffer, 
301
    vsnprintf( msg_buffer, 132, 
302
	      diag_rz_msg_table[ message_number ].ac_text, 
302
	      diag_rz_msg_table[ message_number ].ac_text, 
303
	      ap );
303
	      ap );
304
#endif
304
#endif
Lines 317-329 Link Here
317
	    */
317
	    */
318
318
319
#ifndef NO_MESSAGE_CATALOG
319
#ifndef NO_MESSAGE_CATALOG
320
	    sprintf( loc_buffer,
320
	    snprintf( loc_buffer, 132, 
321
		     catgets(uil_catd, UIL_SET_MISC,
321
		     catgets(uil_catd, UIL_SET_MISC,
322
			     UIL_MISC_0, "\t\t line: %d  file: %s"),
322
			     UIL_MISC_0, "\t\t line: %d  file: %s"),
323
		     az_src_rec->w_line_number,
323
		     az_src_rec->w_line_number,
324
		     src_get_file_name( az_src_rec ) );
324
		     src_get_file_name( az_src_rec ) );
325
#else
325
#else
326
	    sprintf( loc_buffer,
326
	    snprintf( loc_buffer, 132, 
327
		     "\t\t line: %d  file: %s",
327
		     "\t\t line: %d  file: %s",
328
		     az_src_rec->w_line_number,
328
		     az_src_rec->w_line_number,
329
		     src_get_file_name( az_src_rec ) );
329
		     src_get_file_name( az_src_rec ) );
Lines 371-377 Link Here
371
371
372
	    if (l_start_column != diag_k_no_column)
372
	    if (l_start_column != diag_k_no_column)
373
#ifndef NO_MESSAGE_CATALOG
373
#ifndef NO_MESSAGE_CATALOG
374
	      sprintf(loc_buffer,
374
	      snprintf(loc_buffer, 132, 
375
		      catgets(uil_catd, UIL_SET_MISC,
375
		      catgets(uil_catd, UIL_SET_MISC,
376
			      UIL_MISC_1, 
376
			      UIL_MISC_1, 
377
			      "\t\t line: %d  position: %d  file: %s"),
377
			      "\t\t line: %d  position: %d  file: %s"),
Lines 379-385 Link Here
379
		      l_start_column + 1,
379
		      l_start_column + 1,
380
		      src_get_file_name( az_src_rec ) );
380
		      src_get_file_name( az_src_rec ) );
381
#else
381
#else
382
	      sprintf(loc_buffer,
382
	      snprintf(loc_buffer, 132, 
383
		      "\t\t line: %d  position: %d  file: %s",
383
		      "\t\t line: %d  position: %d  file: %s",
384
		      az_src_rec->w_line_number,
384
		      az_src_rec->w_line_number,
385
		      l_start_column + 1,
385
		      l_start_column + 1,
Lines 387-399 Link Here
387
#endif
387
#endif
388
	    else
388
	    else
389
#ifndef NO_MESSAGE_CATALOG
389
#ifndef NO_MESSAGE_CATALOG
390
		sprintf( loc_buffer, catgets(uil_catd, UIL_SET_MISC,
390
		snprintf( loc_buffer, 132, catgets(uil_catd, UIL_SET_MISC,
391
					     UIL_MISC_0,
391
					     UIL_MISC_0,
392
					     "\t\t line: %d  file: %s"),
392
					     "\t\t line: %d  file: %s"),
393
			 az_src_rec->w_line_number,
393
			 az_src_rec->w_line_number,
394
			 src_get_file_name( az_src_rec ) );
394
			 src_get_file_name( az_src_rec ) );
395
#else
395
#else
396
		sprintf( loc_buffer,
396
		snprintf( loc_buffer, 132, 
397
			 "\t\t line: %d  file: %s",
397
			 "\t\t line: %d  file: %s",
398
			 az_src_rec->w_line_number,
398
			 az_src_rec->w_line_number,
399
			 src_get_file_name( az_src_rec ) );
399
			 src_get_file_name( az_src_rec ) );
(-)openMotif-2.2.3/clients/uil/UilSymDef.h.UIL (-4 / +9 lines)
Lines 65-70 Link Here
65
65
66
#include <Mrm/MrmPublic.h>
66
#include <Mrm/MrmPublic.h>
67
#include <Xm/Xm.h>
67
#include <Xm/Xm.h>
68
#include <X11/Xos.h>
69
#ifndef PATH_MAX
70
#  define PATH_MAX 256
71
#endif
72
68
73
69
/*
74
/*
70
**  constraint check access macro
75
**  constraint check access macro
Lines 874-883 Link Here
874
    sym_section_entry_type	*sections;
879
    sym_section_entry_type	*sections;
875
	/* pointer to a section list; this list is all of the sections that */
880
	/* pointer to a section list; this list is all of the sections that */
876
	/* exist in this include file.					    */
881
	/* exist in this include file.					    */
877
    char			file_name[255];
882
    char			file_name[PATH_MAX];
878
	/* the file name as specified in the include statement in the UIL   */
883
	/* the file name as specified in the include statement in the UIL   */
879
	/* source.							    */
884
	/* source.							    */
880
    char			full_file_name[255];
885
    char			full_file_name[PATH_MAX];
881
	/* the expanded name for the include file actually opened.	    */
886
	/* the expanded name for the include file actually opened.	    */
882
} sym_include_file_entry_type;
887
} sym_include_file_entry_type;
883
888
Lines 894-902 Link Here
894
	/* common header						    */
899
	/* common header						    */
895
    struct _src_source_record_type	*src_record_list;
900
    struct _src_source_record_type	*src_record_list;
896
	/* pointer to a list of source records.				    */
901
	/* pointer to a list of source records.				    */
897
    char			file_name[255];
902
    char			file_name[PATH_MAX];
898
	/* the main UIL file name as specified on the command line.	    */
903
	/* the main UIL file name as specified on the command line.	    */
899
    char			full_file_name[255];
904
    char			full_file_name[PATH_MAX];
900
	/* the expanded name for the main UIL file that was actually	    */
905
	/* the expanded name for the main UIL file that was actually	    */
901
	/* opened.							    */
906
	/* opened.							    */
902
    sym_section_entry_type	*sections;
907
    sym_section_entry_type	*sections;

Return to bug 114234