~ubuntu-branches/ubuntu/lucid/unrar-nonfree/lucid

« back to all changes in this revision

Viewing changes to consio.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Meredith
  • Date: 2009-06-06 17:46:05 UTC
  • mfrom: (1.1.11 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090606174605-h4ciqxlpy39jmjx0
Tags: 1:3.9.3-1
* New upstream release
* Updated Copyright file (Closes: #531432)

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
#endif
255
255
 
256
256
 
257
 
int KbdAnsi(char *Addr,int Size)
 
257
int KbdAnsi(char *Addr,size_t Size)
258
258
{
259
259
  int RetCode=0;
260
260
#ifndef GUI
261
 
  for (int I=0;I<Size;I++)
 
261
  for (size_t I=0;I<Size;I++)
262
262
    if (Addr[I]==27 && Addr[I+1]=='[')
263
263
    {
264
 
      for (int J=I+2;J<Size;J++)
 
264
      for (size_t J=I+2;J<Size;J++)
265
265
      {
266
266
        if (Addr[J]=='\"')
267
267
          return(2);
275
275
}
276
276
 
277
277
 
278
 
void OutComment(char *Comment,int Size)
 
278
void OutComment(char *Comment,size_t Size)
279
279
{
280
280
#ifndef GUI
281
281
  if (KbdAnsi(Comment,Size)==2)
282
282
    return;
283
 
  const int MaxOutSize=0x400;
284
 
  for (int I=0;I<Size;I+=MaxOutSize)
 
283
  const size_t MaxOutSize=0x400;
 
284
  for (size_t I=0;I<Size;I+=MaxOutSize)
285
285
  {
286
286
    char Msg[MaxOutSize+1];
287
 
    int CopySize=Min(MaxOutSize,Size-I);
 
287
    size_t CopySize=Min(MaxOutSize,Size-I);
288
288
    strncpy(Msg,Comment+I,CopySize);
289
289
    Msg[CopySize]=0;
290
290
    mprintf("%s",Msg);