]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/strutl.cc
Merge branch 'debian/sid' into debian/experimental
[apt.git] / apt-pkg / contrib / strutl.cc
index d0e74d8c59cd0590c5d16f2b9252474c45b106e6..df02c3499c5b681041c27b9a3e9eef4c4fe6b535 100644 (file)
@@ -1233,12 +1233,12 @@ char *safe_snprintf(char *Buffer,char *End,const char *Format,...)
    va_list args;
    int Did;
 
-   va_start(args,Format);
-
    if (End <= Buffer)
       return End;
-
+   va_start(args,Format);
    Did = vsnprintf(Buffer,End - Buffer,Format,args);
+   va_end(args);
+
    if (Did < 0 || Buffer + Did > End)
       return End;
    return Buffer + Did;