mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
29 lines
421 B
C#
29 lines
421 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace UseOfSystemOutputStream.cs
|
|
{
|
|
class Main
|
|
{
|
|
|
|
public void Foo(string s, TextWriter t)
|
|
{
|
|
|
|
Console.WriteLine("string: " + s); // BAD
|
|
|
|
t.WriteLine(s); // GOOD
|
|
|
|
t = Console.Out; // BAD
|
|
|
|
t.WriteLine(s); // GOOD
|
|
|
|
Console.SetError(t); // GOOD
|
|
|
|
t = Console.Error; // GOOD
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|