Ticket #14930: BitmapSetSaver.cpp.diff

File BitmapSetSaver.cpp.diff, 1.1 KB (added by MarshallBanana, 6 years ago)
  • src/apps/icon-o-matic/document/savers/BitmapSetSaver.cpp

    a b status_t  
    2828BitmapSetSaver::Save(Document* document)
    2929{
    3030    entry_ref actualRef(fRef);
    31     char name[B_OS_NAME_LENGTH];
     31    BString name;
    3232
    3333    // 64x64
    34     snprintf(name, sizeof(name), "%s_64.png", fRef.name);
    35     actualRef.set_name(name);
     34    name.SetToFormat("%s_%d.png", fRef.name, 64);
     35    actualRef.set_name(name.String());
    3636    Exporter* exporter = new BitmapExporter(64);
    3737    exporter->SetSelfDestroy(true);
    3838    exporter->Export(document, actualRef);
    3939
    4040    // 16x16
    41     snprintf(name, sizeof(name), "%s_16.png", fRef.name);
    42     actualRef.set_name(name);
     41    name.SetToFormat("%s_%d.png", fRef.name, 16);
     42    actualRef.set_name(name.String());
    4343    exporter = new BitmapExporter(16);
    4444    exporter->SetSelfDestroy(true);
    4545    exporter->Export(document, actualRef);
    4646
    4747    // 32x32
    48     snprintf(name, sizeof(name), "%s_32.png", fRef.name);
    49     actualRef.set_name(name);
     48    name.SetToFormat("%s_%d.png", fRef.name, 32);
     49    actualRef.set_name(name.String());
    5050    exporter = new BitmapExporter(32);
    5151    exporter->SetSelfDestroy(true);
    5252    exporter->Export(document, actualRef);