VirtualBox

Changeset 33977 in vbox for trunk/src/VBox/RDP/client


Ignore:
Timestamp:
Nov 11, 2010 11:42:07 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67639
Message:

*: replaced a bunch of sprintf() by snprintf()

Location:
trunk/src/VBox/RDP/client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/RDP/client/disk.c

    r33656 r33977  
    364364        if (*filename && filename[strlen(filename) - 1] == '/')
    365365                filename[strlen(filename) - 1] = 0;
     366#ifdef VBOX
     367        snprintf(path, sizeof(path),  "%s%s", g_rdpdr_device[device_id].local_path, filename);
     368#else
    366369        sprintf(path, "%s%s", g_rdpdr_device[device_id].local_path, filename);
     370#endif
    367371
    368372        switch (create_disposition)
     
    820824                        }
    821825
     826#ifdef VBOX
     827                        snprintf(fullpath, sizeof(fullpath), "%s%s", g_rdpdr_device[pfinfo->device_id].local_path,
     828                                newname);
     829#else
    822830                        sprintf(fullpath, "%s%s", g_rdpdr_device[pfinfo->device_id].local_path,
    823831                                newname);
     832#endif
    824833
    825834                        if (rename(pfinfo->path, fullpath) != 0)
     
    11561165
    11571166                        /* Get information for directory entry */
     1167#ifdef VBOX
     1168                        snprintf(fullpath, sizeof(fullpath), "%s/%s", dirname, pdirent->d_name);
     1169#else
    11581170                        sprintf(fullpath, "%s/%s", dirname, pdirent->d_name);
     1171#endif
    11591172
    11601173                        if (stat(fullpath, &filestat))
  • trunk/src/VBox/RDP/client/printer.c

    r33656 r33977  
    126126        else
    127127        {
     128#ifdef VBOX
     129                snprintf(cmd, sizeof(cmd), "lpr -P %s", pprinter_data->printer);
     130#else
    128131                sprintf(cmd, "lpr -P %s", pprinter_data->printer);
     132#endif
    129133                pprinter_data->printer_fp = popen(cmd, "w");
    130134        }
  • trunk/src/VBox/RDP/client/rdesktop.c

    r33656 r33977  
    15941594                return False;
    15951595
     1596#ifdef VBOX
     1597        snprintf(bmpcache_dir, sizeof(bmpcache_dir), "%s/%s", home, ".rdesktop");
     1598#else
    15961599        sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop");
     1600#endif
    15971601
    15981602        if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
     
    16021606        }
    16031607
     1608#ifdef VBOX
     1609        snprintf(bmpcache_dir, sizeof(bmpcache_dir), "%s/%s", home, ".rdesktop/cache");
     1610#else
    16041611        sprintf(bmpcache_dir, "%s/%s", home, ".rdesktop/cache");
     1612#endif
    16051613
    16061614        if ((mkdir(bmpcache_dir, S_IRWXU) == -1) && errno != EEXIST)
     
    16241632        if (home == NULL)
    16251633                return -1;
     1634#ifdef VBOX
     1635        snprintf(fn, sizeof(fn), "%s/.rdesktop/%s", home, filename);
     1636#else
    16261637        sprintf(fn, "%s/.rdesktop/%s", home, filename);
     1638#endif
    16271639        fd = open(fn, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
    16281640        if (fd == -1)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette