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

Collapse All | Expand All

(-)./sharutils-4.2.1/src/shar.c (-3 / +3 lines)
Lines 1571-1577 Link Here
1571
	  sprintf (command, "%s '%s'", CHARACTER_COUNT_COMMAND, local_name);
1571
	  sprintf (command, "%s '%s'", CHARACTER_COUNT_COMMAND, local_name);
1572
	  if (pfp = popen (command, "r"), pfp)
1572
	  if (pfp = popen (command, "r"), pfp)
1573
	    {
1573
	    {
1574
	      char wc[BUFSIZ];
1574
		char wc[BUFSIZ], tempform[50];      
1575
	      const char *prefix = "";
1575
	      const char *prefix = "";
1576
1576
1577
	      if (did_md5)
1577
	      if (did_md5)
Lines 1579-1586 Link Here
1579
		  fputs ("  else\n", output);
1579
		  fputs ("  else\n", output);
1580
		  prefix = "  ";
1580
		  prefix = "  ";
1581
		}
1581
		}
1582
1582
	sprintf (tempform, "%%%ds", BUFSIZ - 1);
1583
	      fscanf (pfp, "%s", wc);
1583
	fscanf (pfp, tempform, wc);
1584
	      fprintf (output, "\
1584
	      fprintf (output, "\
1585
%s  shar_count=\"`%s '%s'`\"\n\
1585
%s  shar_count=\"`%s '%s'`\"\n\
1586
%s  test %s -eq \"$shar_count\" ||\n\
1586
%s  test %s -eq \"$shar_count\" ||\n\
(-)./sharutils-4.2.1/src/unshar.c (-10 / +11 lines)
Lines 346-353 Link Here
346
{
346
{
347
  size_t size_read;
347
  size_t size_read;
348
  FILE *file;
348
  FILE *file;
349
  char name_buffer[NAME_BUFFER_SIZE];
349
  char name_buffer[NAME_BUFFER_SIZE] = {'\0'};
350
  char copy_buffer[NAME_BUFFER_SIZE];
350
  char copy_buffer[NAME_BUFFER_SIZE] = {'\0'};
351
  int optchar;
351
  int optchar;
352
352
353
  program_name = argv[0];
353
  program_name = argv[0];
Lines 409-422 Link Here
409
  if (optind < argc)
409
  if (optind < argc)
410
    for (; optind < argc; optind++)
410
    for (; optind < argc; optind++)
411
      {
411
      {
412
	if (argv[optind][0] == '/')
412
	if (argv[optind][0] == '/') {
413
	  stpcpy (name_buffer, argv[optind]);
413
		strncpy (name_buffer, argv[optind], sizeof(name_buffer));
414
	else
414
		name_buffer[sizeof(name_buffer)-1] = '\0';
415
	  {
415
	}
416
	    char *cp = stpcpy (name_buffer, current_directory);
416
	else {
417
	    *cp++ = '/';
417
		char *cp = (char *)malloc(strlen(name_buffer)+1);
418
	    stpcpy (cp, argv[optind]);
418
		*cp++ = '/';
419
	  }
419
		strncpy(cp, argv[optind], sizeof(name_buffer));
420
	}
420
	if (file = fopen (name_buffer, "r"), !file)
421
	if (file = fopen (name_buffer, "r"), !file)
421
	  error (EXIT_FAILURE, errno, name_buffer);
422
	  error (EXIT_FAILURE, errno, name_buffer);
422
	unarchive_shar_file (name_buffer, file);
423
	unarchive_shar_file (name_buffer, file);

Return to bug 65773