Bug in MQX 3.8 printf ignoring width specifier

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Bug in MQX 3.8 printf ignoring width specifier

500件の閲覧回数
RoyAtRce
Contributor II

The printf implementation in MQX 3.8 appears to be ignoring the width specifier for strings.

 

I expect

 

printf("%3.3", "ABCD")

 

to output:

 

ABC

 

but I actually get:

 

ABCD

 

 

0 件の賞賛
返信
2 返答(返信)

348件の閲覧回数
RoyAtRce
Contributor II

Its actually the precision not the width it is mishandling.

348件の閲覧回数
c0170
Senior Contributor III

Hello RoyAtRce,

 

your printf contains width (specifies minimum characters) and also a  precision specifier (maximum characters). This applies to strings.

 

I tested it and it really ignores the precision specifier.

 

Thanks for your feedback. We are going to fix this.

 

Regards,

MartinK

0 件の賞賛
返信