[Bug 2028151] Re: Problem with sprintf under Ubuntu 23.04

Brian Murray 2028151 at bugs.launchpad.net
Wed Jul 19 17:31:10 UTC 2023


** Package changed: ubuntu => glibc (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/2028151

Title:
  Problem with sprintf under Ubuntu 23.04

Status in glibc package in Ubuntu:
  New

Bug description:
  Problem with sprintf under Ubuntu 23.04

  I have a problem with a program under Ubuntu 23.04.

  If I compile it under 22.04 and copy the binary to 23.04 I see the problem.
  Likewise if I compile and run it on 23.04.
  On 22.04 I do not see the problem.


  #include <stdio.h>

  int main(int argc, char** argv)
  {
  	int ch, i,offset;
  	char s_text[60]={0};
  	offset=3;
      s_text[0]='*';
  	printf("   |%s|\n",s_text);
  	for(i = 0; i < offset; ++i)
  		{
  		sprintf(s_text,"%s.",s_text);
  		printf("%d. |%s|\n",i,s_text);
  		}
  	return 0;
  }


  // Not working output
  //    |*|
  // 0. |.|
  // 1. |.|
  // 2. |.|

  If I remove "#include <stdio.h> " it works also under 23.04.
  But I need <stdio.h> for other program parts.

  // Working output
  //    |*|
  // 0. |*.|
  // 1. |*..|
  // 2. |*...|

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2028151/+subscriptions




More information about the foundations-bugs mailing list